机器1:ubuntu 1404 机器2:openwrt
实现ubuntu免密码登入openwrt
ubuntu:
点击(此处)折叠或打开
-
listome-bao@listomebao-computer:~$ ssh-keygen -t rsa
-
Generating public/private rsa key pair.
-
Enter file in which to save the key (/home/listome-bao/.ssh/id_rsa):
-
Enter passphrase (empty for no passphrase):
-
Enter same passphrase again:
-
Your identification has been saved in /home/listome-bao/.ssh/id_rsa.
-
Your public key has been saved in /home/listome-bao/.ssh/id_rsa.pub.
-
The key fingerprint is:
-
生成了id_rsa.pub 将其传到openwrt 的 /etc/dropbear/ 下改成authorized_keys
即可
之前如果建立 ssh 连接,只要將公钥复制到 ~/.ssh/authorized_keys 就可以利用公钥登入,而不需要建立密码。
现在的 ssh 使用同样的方法会出現错误信息:
Agent admitted failure to sign using the key
解決方法:
使用 ssh-add 指令將私钥加进来(根据个人的密匙命名不同更改 id_rsa)
# ssh-add ~/.ssh/id_rsa
阅读(5339) | 评论(0) | 转发(0) |