0

私は現在、ubuntu であるリモートawsインスタンスにsshを使用して接続しています。しかし、ec2インスタンスのsshキー(.pemファイル)をDownloadから自分のラップトップにある.sshフォルダに移動した後には、Could not resolve hostname mypath/myssh.pem provided, or not knownが表示されます。私はかなりユーザー名とサーバー名を間違っていると確信しています。 私が設定していないものがありますか?他に
、それはdebug1: Trying private key: Mypathtokey/my.pem debug1: Authentications that can continue: publickey debug1: No more authentication methods to try.AWS接続が拒否されました

編集 私のコマンド

ssh -i ~/.ssh/my.pem [email protected] 

は、私はまたはssh_configにssh awsを設定することを示してssh -vながら。 ssh -vvv awsを使用しているときは、

debug1: Next authentication method: publickey 
debug1: Trying private key: /Users/mypath/.ssh/ssh.pem 
debug2: storing passphrase in keychain 
debug3: Search for existing item with query: { 
    acct = "/Users/mypath/.ssh/ssh.pem"; 
    agrp = "com.apple.ssh.passphrases"; 
    class = genp; 
    labl = "SSH: /Users/mypath/.ssh/ssh.pem"; 
    nleg = 1; 
    "r_Ref" = 1; 
    svce = OpenSSH; 
} 
debug3: Item already exists in the keychain, updating. 
debug3: sign_and_send_pubkey: RSA SHA256: my rsa sha256 keyvalue 
debug3: receive packet: type 51 
debug1: Authentications that can continue: publickey 
debug2: we did not send a packet, disable method 
debug1: No more authentication methods to try. 
Permission denied (publickey). 
+0

使用しているコマンドを表示します。 – Justinas

+0

* "私のsshキーを別のフォルダに移動した後" * ...どのキー? ONサーバーまたはクライアント?どうして? – Jakuje

+0

ec2インスタンスのsshキー(.pemファイル)を自分のラップトップでダウンロードから.sshフォルダに移動するのは、最初にダウンロードファイルでec2インスタンスに接続しようとしたためです – EEEEEric

答えて

0

.pemファイルのアクセス許可を確認しましたか? 600に変更して接続してみてください。それが問題を解決することを願っています。

関連する問題