$ ssh root@10.2.8.41 root@10.2.8.41's password: Last login: Thu Nov 111:34:052018from10.2.0.33 [root@hardwareupdate ~]#
密钥登录
创建密钥
1 2 3 4 5 6 7 8 9 10
[root@host ~]$ ssh-keygen -t rsa <== 建立密钥对 Generating public/private rsa key pair. Enter file in which to save the key (/root/.ssh/id_rsa): <== 按 Enter Created directory '/root/.ssh'. Enter passphrase (empty for no passphrase): <== 输入密钥锁码,或直接按 Enter 留空 Enter same passphrase again: <== 再输入一遍密钥锁码 Your identification has been saved in /root/.ssh/id_rsa. <== 私钥 Your public key has been saved in /root/.ssh/id_rsa.pub. <== 公钥 The key fingerprint is: 0f:d3:e7:1a:1c:bd:5c:03:f1:19:f1:22:df:9b:cc:08 root@host
密钥生成以后,在.ssh下面会多两个文件,id_rsa.pub是公钥,id_rsa是私钥
1 2 3
[root@host ~]$ cd ~/.ssh [root@host .ssh]$ ls id_rsa id_rsa.pub known_hosts config