The programs included with the Debian GNU/Linux system are free software; the exact distribution terms for each program are described in the individual files in/usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law. Last login: Wed Jul 501:14:122017 from localhost tiaoban@xxxxx:~ $ exit
2.连接 server
➜ ssh ssh server The authenticity of host '192.168.1.117 (<no hostip for proxy command>)' can't be established. ECDSA key fingerprint is SHA256:b7RMtN02b8r/eWg2a5WPMzuNibmyDAKTxP9U0xNMgts. Are you sure you want tocontinue connecting (yes/no)? yes Warning: Permanently added '192.168.1.117' (ECDSA) to the list of known hosts. root@192.168.1.117's password: Killed by signal 2.
连接 server 提示需要密码这个时候我们可以给远程主机添加一条本地的公钥
➜ ssh ssh-copy-id server /usr/local/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/Users/wenjun/.ssh/id_rsa.pub" /usr/local/bin/ssh-copy-id: INFO: attempting tologinwiththe new key(s), to filter out any that are already installed /usr/local/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys root@192.168.1.117's password: Killed by signal 1.
Number of key(s) added: 1
Now try logging intothe machine, with: "ssh 'server'" and check to make sure that only the key(s) you wanted were added.
然后再次连接就不需要啦
➜ ssh ssh server Last login: Tue Jul 410:03:252017from192.168.1.155 [root@server ~]# exit logout Connectionto192.168.1.117 closed. Killed by signal 1.