[問題] ssh public key登入問題
各位好, 近期小弟正在嘗試設定public key登入, 且把ssh password關掉
目前環境是使用兩個虛擬機上面都是ubuntu 14.04
之後以A和B表示這兩台, A為client端, B為server端
我看網路教學操作, 步驟如下:
1. 先在A上面執行ssh-keygen (一路按enter) 然後產生id_rsa以及id_rsa.pub檔
2. 然後執行ssh-copy-id user@B的ip, 我在B的 ~/.ssh/authorized_keys中有看到A的
id_rsa.pub的內容
3. 之後我在B修改了/etc/ssh/sshd_config的內容, 更改內容如下:
RSAAuthentication yes
PubkeyAuthentication yes
AuthorizedKeysFile %h/.ssh/authorized_keys
PasswordAuthentication no
4. 最後執行了service ssh restart
5. 之後再由A執行ssh user@B的IP
但問題開始了...我在虛擬機上登入B時, 用A去ssh B是沒問題的也不需要密碼
然後另外用手機去ssh B也確定就算輸入密碼也無法登入
但是...我只要在虛擬機上B執行了exit, 我再用A去ssh時就會出現
"Permission denied (publickey)."
重新設定一次也一樣的狀況, 我也試著找一台windows電腦做client端的動作也是
唯獨要在虛擬機上保持B登入的狀態我才能從別的機器透過金鑰ssh
想請求版上高手們協助我解決這個問題!!!麻煩了~~
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 180.218.163.3
※ 文章網址: https://www.ptt.cc/bbs/Linux/M.1526809867.A.DCC.html
→
05/20 18:32,
7年前
, 1F
05/20 18:32, 1F
→
05/20 18:33,
7年前
, 2F
05/20 18:33, 2F
→
05/20 18:35,
7年前
, 3F
05/20 18:35, 3F
→
05/20 18:36,
7年前
, 4F
05/20 18:36, 4F
→
05/20 18:37,
7年前
, 5F
05/20 18:37, 5F
推
05/20 20:27,
7年前
, 6F
05/20 20:27, 6F
推
05/20 21:01,
7年前
, 7F
05/20 21:01, 7F
→
05/20 21:36,
7年前
, 8F
05/20 21:36, 8F
推
05/20 22:39,
7年前
, 9F
05/20 22:39, 9F
推
05/21 00:05,
7年前
, 10F
05/21 00:05, 10F
→
05/21 00:05,
7年前
, 11F
05/21 00:05, 11F
推
05/21 10:57,
7年前
, 12F
05/21 10:57, 12F
Linux 近期熱門文章
21
56
PTT數位生活區 即時熱門文章