1、准备ssh-copy-id
brew install ssh-copy-id
2、生成私钥公钥
ssh-keygen -t rsa -b 1024
3、将公钥上传致服务器(~/.ssh/authorized_keys)
ssh-copy-id -i 公钥 [email protected]
4、在本地~/.ssh/config文件中添加(如果没有则新建)
Host git.oschina.net
IdentityFile ~/.ssh/weiwei.sun
Host 192.168.50.100
IdentityFile ~/.ssh/weiwei.sun
标签:公钥,weiwei,192.168,mac,ssh,copy,id From: https://blog.51cto.com/u_15887056/5875400