還有就是-f
和-N
選項正是爲:
-f Requests ssh to go to background just before command execution. This is useful if
ssh is going to ask for passwords or passphrases, but the user wants it in the
background. This implies -n. The recommended way to start X11 programs at a remote
site is with something like ssh -f host xterm.
If the ExitOnForwardFailure configuration option is set to ``yes'', then a client
started with -f will wait for all remote port forwards to be successfully established
before placing itself in the background.
-N Do not execute a remote command. This is useful for just forwarding ports
(protocol version 2 only).
所以完整的命令將ssh -fNL 1111:servera:2222 [email protected]rverb
。
防止ssh詢問密碼的一種方法也是使用SSH public keys與代理進行身份驗證,該代理會保存密碼或使用外部圖形程序(如pinentry)提示密碼。
查看autossh可能也很有用,它會在連接斷開時自動重新連接SSH。
看看[x2go](http://wiki.x2go.org/doku.php)! –