$ vim ~/.ssh/config 添加以下配置:
Host *
ControlMaster auto #多窗口共享登陆状态
ControlPath ~/.ssh/%h-%p-%r
ControlPersist yes #登陆状态保留时间,yes表示永久,除非网络断开
Host mars #快捷别名
hostname mars.com #远程机器
user yanjingang #用户名
$
ssh mars #使用别名登陆
登陆后在新窗口再次运行ssh mars时不用输入密码,会自动登陆
yan 17.12.1
