Linux SSH Tips

2011/07/21 張貼者: Damon.Huang
Multiple Connections
第一次連線成功後,再開一個視窗連線同一台主機時,就會用原本的連線來進行連接,也不需要再輸入一次密碼
# vi ~/.ssh/config 
加入以下兩行
ControlMaster auto
ControlPath /tmp/ssh_mux_%h_%p_%r
Avoiding Delays
連線到其他主機時,在出現詢問密碼時,要經過幾十秒的等待
# vi ~/.ssh/config 
GSSAPIAuthentication no
也可直接修改 /etc/ssh/sshd_config
# vi /etc/ssh/sshd_config
GSSAPIAuthentication no
GSSAPIDelegateCredentials no
Example:
##############################
# Connection sharing
##############################
ControlMaster auto
ControlPath /tmp/ssh_mux_%h_%p_%r

##############################
# Persistent connections(4 hrs)
##############################
ControlPersist 4h

##############################
# Hostname Aliases
##############################
Host o1
HostName srv1.example1.com

Host o2
HostName srv2.example1.com
User root

Host neb1
HostName srv3.example2.com
User root

Host neb2
HostName srv4.example2.com
User root

##############################
# Avoiding Delays
##############################
GSSAPIAuthentication no

Reference:

標籤: ,

張貼留言

技術提供:Blogger.