autossh -M 0 -f -N vps # -M 0 : autossh echo port, recommend disable it by setting it to 0 # -f : run in background # -N : not execute remote command, useful for forwarding ports
就會等同於打以下指令
1 2 3 4
autossh -M 0 -f -N -o "ServerAliveInterval 30" -o "ServerAliveCountMax 3" -L 5555:localhost:6666 oalieno@123.45.67.89 # -M 0 : autossh echo port, recommend disable it by setting it to 0 # -f : run in background # -N : not execute remote command, useful for forwarding ports
escape sequence
有時候連線斷掉後,畫面就會卡在那裡
這時候就可以直接在鍵盤上打 ~. 這個 escape sequences 就可以直接跳出來啦,感覺像是在逃脫 vim 呢xD
下面還有更多的神秘金手指可以打
1 2 3 4 5 6 7 8 9 10 11 12
Supported escape sequences: ~. - terminate connection (and any multiplexed sessions) ~B - send a BREAK to the remote system ~C - open a command line ~R - request rekey ~V/v - decrease/increase verbosity (LogLevel) ~^Z - suspend ssh ~# - list forwarded connections ~& - background ssh (when waiting for connections to terminate) ~? - this message ~~ - send the escape character by typing it twice (Note that escapes are only recognized immediately after newline.)