.ssh/config 常用配置
作者:互联网
不用每次都 -i 指定密钥,且避免连接自动断开
ControlMaster auto
ControlPath ~/.ssh/connection-%r@%h:%p
ControlPersist 4h
ServerAliveInterval 6
ServerAliveCountMax 20
Compression yes
Host github.com
HostName github.com
User git
IdentityFile ~/.ssh/github
Host hangj
Hostname mydomain.name
User hangj
IdentityFile ~/.ssh/hk
然后 ssh hangj
就可以连上我的服务器
拷贝文件
scp file.txt hangj:~/
scp hangj:~/file.txt ./
简单,高效,省心,还防脱发
标签:IdentityFile,常用,github,ssh,file,hangj,txt,config 来源: https://www.cnblogs.com/hangj/p/11506686.html