1 .已有的.ssh 目录以及里面的文件可以删除 //find / -name .ssh 查找一下
2.为做实验我已删除该目录
$ssh-keygen -t rsa //新建数字证书
Enter file in which to save the key (/home/acer/.ssh/id_rsa): // 默认目录,你也可以改,但不建议
Created directory '/home/xiaoli/.ssh'.
Enter passphrase (empty for no passphrase): //一个全新的口令
Enter same passphrase again: //再一次确认
Your identification has been saved in /home/xiaoli/.ssh/id_rsa.
Your public key has been saved in /home/xiaoli/.ssh/id_rsa.pub.
The key fingerprint is:
55:a2:c1:a3:54:de:73:82:6c:b4:e0:b7:ea:7f:52:f0 xiaoli@acermt
The key's randomart image is:
+--[ RSA 2048]----+
| .o+ . . |
| ..=o* o |
| ...O.= . |
| .o.o + |
| So |
| . E |
| . . |
| . . . |
| ...o |
+-----------------+
3. cd /home/acer/
4. ll -a
5. 有 id_rsa 私钥 和 id_rsa.pub 公钥文件
6. 私钥600 公钥700
7. 私钥 自己保存 公钥发给对方 ssh-copy-id -i .ssh/id_rsa.pub 192.168.0.1 (对方主机ip)
也可以 scp .ssh/id_rsa.pub root@192.168.0.1:/root/.ssh/authorized_keys
8. 应该可以登录了 两个linux 系统之间。 刚试过登录一个w7没成!!
9. 明天找机子再试.
阅读(1013) | 评论(0) | 转发(0) |