我在Amazon EC2上創建了Ubuntu 12.04實例。嘗試使用RSA密鑰SSH進入EC2,獲取:錯誤的RSA1標識符...權限被拒絕(公鑰)
我已經下載了PEM文件,並能夠通過SSH進入實例,沒有問題。
現在,我想在遠程實例上爲顧問等創建一些帳戶。 他們應該能夠使用RSA密鑰ssh進入方框。在EC2機器上,我在〜/ home /中設置了幾個帳戶,並將它們分配給組管理員。我也給了自己一個類似的帳戶(MyTestAccount)進行測試。這是我做過什麼:
我使用的主要根到我的本地機器(的〜/ .ssh)上創建的.ssh目錄公鑰和私鑰:
drwx------ 2 peter peter 1024 Sep 14 10:23 .ssh
而且裏面的文件:
-rw------- 1 peter peter 1675 Sep 14 10:23 id_rsa
-rw------- 1 peter peter 394 Sep 14 10:23 id_rsa.pub
-rw------- 1 peter peter 444 Sep 14 00:05 known_hosts
然後我SCP'd的id_rsa.pub文件到我的遠程EC2實例,並將其添加到我的遠程實例的 的.ssh/authorized_keys文件。我的遠程 .ssh目錄的權限:
drwx------ 2 ubuntu ubuntu 4096 Sep 16 16:13 .ssh
我的authorized_keys的和文件:
-rw------- 1 peter ubuntu 1179 Sep 14 00:05 authorized_keys
接下來,我註銷我的遠程實例,並嘗試使用新的密鑰SSH到遙控盒。當我發出以下命令:
[email protected]:~/.ssh$ ssh -vvv [email protected]
我得到的下面。它看起來像我的私鑰有問題嗎?有什麼建議麼?謝謝。
OpenSSH_5.9p1 Debian-5ubuntu1, OpenSSL 1.0.1 14 Mar 2012
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug2: ssh_connect: need priv 0
debug1: Connecting to ec2-XX-XXX-XX-XXX.compute-1.amazonaws.com [XX.XXX.XX.XXX] port 22.
debug1: Connection established.
debug3: Incorrect RSA1 identifier
debug3: Could not load "/home/peter/.ssh/id_rsa" as a RSA1 public key
debug1: identity file /home/peter/.ssh/id_rsa type 1
debug1: Checking blacklist file /usr/share/ssh/blacklist.RSA-2048
debug1: Checking blacklist file /etc/ssh/blacklist.RSA-2048
debug1: identity file /home/peter/.ssh/id_rsa-cert type -1
debug1: identity file /home/peter/.ssh/id_dsa type -1
debug1: identity file /home/peter/.ssh/id_dsa-cert type -1
debug1: identity file /home/peter/.ssh/id_ecdsa type -1
debug1: identity file /home/peter/.ssh/id_ecdsa-cert type -1
[SNIP ...]
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue: publickey
debug1: Trying private key: /home/peter/.ssh/id_dsa
debug3: no such identity: /home/peter/.ssh/id_dsa
debug1: Trying private key: /home/peter/.ssh/id_ecdsa
debug3: no such identity: /home/peter/.ssh/id_ecdsa
debug2: we did not send a packet, disable method
debug1: No more authentication methods to try. **Permission denied (publickey).**
您是否嘗試過建立與'SSH -i /路徑/到/你/鍵yourserver' SSH連接?來自論壇的「 – j0nes