- vim ~/.ssh/config (若不存在可以新建)
Host www HostName www.ttlsa.com Port 22 User root IdentityFile ~/.ssh/id_rsa.pub IdentitiesOnly yes Host bbs HostName 115.28.45.104 User anotheruser PubkeyAuthentication no注释
HostName 指定登录的主机名或IP地址 Port 指定登录的端口号 User 登录用户名 IdentityFile 登录的公钥文件 (可选) IdentitiesOnly 只接受SSH key 登录 (可选) PubkeyAuthentication (可选)修改config
sudo chmod 600 config修改rsa
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ WARNING: UNPROTECTED PRIVATE KEY FILE! @ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ Permissions 0777 for '/root/.ssh/id_rsa' are too open. It is required that your private key files are NOT accessible by others. This private key will be ignored. Load key "/root/.ssh/id_rsa": bad permissions Permission denied (publickey).chmod -R 700 /root
版权声明:本文为wjlwangluo原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。