1) mkdir -p ~/.ssh/ecs
2) ssh-keygen -t rsa -b 4096 -C “xoinstein.com” -f ~/.ssh/ecs/xoinstein.com
3) ssh-copy-id -i ~/.ssh/ecs/xoinstein.com -p 22 root@xoinstein.com
4) ssh-add -K ~/.ssh/ecs/xoinstein.com
5) vi ~/.ssh/config 添加以下代码:
Host ali-xo
HostName xoinstein.com
AddKeysToAgent yes
UseKeychain yes
IdentityFile ~/.ssh/ecs/xoinstein.com
6) ssh ali-xo登陆服务器