1.生成公钥和私钥 ssh-keygen -t dsa 2.发送公钥 oldboy888@ser200 .ssh]$ ssh-copy-id -i id_dsa.pub "-p 20000 oldboy888@192.168.1.201" 10 The authenticity of host ‘192.168.1.201 (192.168.1.201)‘ can‘t be established. RSA key fingerprint is 0a:13:db:54:60:3e:85:46:b5:ea:d5:b9:c0:5e:51:74. Are you sure you want to continue connecting (yes/no)? Host key verification failed. [oldboy888@ser200 .ssh]$ ssh-copy-id -i id_dsa.pub "-p 20000 oldboy888@192.168.1.201"> ; 10 The authenticity of host ‘192.168.1.201 (192.168.1.201)‘ can‘t be established. RSA key fingerprint is 0a:13:db:54:60:3e:85:46:b5:ea:d5:b9:c0:5e:51:74. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added ‘192.168.1.201‘ (RSA) to the list of known hosts. oldboy888@192.168.1.201‘s password: Now try logging into the machine, with "ssh ‘-p 20000 oldboy888@192.168.1.201‘", and check in: .ssh/authorized_keys to make sure we haven‘t added extra keys that you weren‘t expecting. 3.检查是否免密码论证 [oldboy888@ser200 .ssh]$ ssh -p2000 oldboy888@192.168.1.201 free -m ssh: connect to host 192.168.1.201 port 2000: Connection refused [oldboy888@ser200 .ssh]$ ssh -p20000 oldboy888@192.168.1.201 free -m total used free shared buffers cached Mem: 484 71 412 0 9 30 -/+ buffers/cache: 31 452 Swap: 1027 0 1027
本文出自 “蜘蛛侠” 博客,请务必保留此出处http://txidc.blog.51cto.com/9138217/1562397
原文地址:http://txidc.blog.51cto.com/9138217/1562397