2
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

VS Code Remote SSHで、Could not establish connection to : Permission denied(publickey,gssapi-keyex,gssapi-with-mic,password).

Posted at

解決までの経緯

スクリーンショット 2021-09-13 20.58.49.png

💡解決方法

エラー内容

Could not establish connection to "OFLog-dev-env": Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).

結論:私の場合は、エラーでもなんでもありませんでした。

スクリーンショット 2021-09-13 23.09.50.png

エラーが表示される前に上記の画面が表示されると思いますが、入力欄に
設定したssh接続用のパスワードを入力 → Enterするだけでした。

エラーが出る原因はおそらく

  • パスワードが違う
  • 本当に権限がない

どちらかだと思います。

権限の設定(おまけ)

スクリーンショット 2021-09-13 23.18.51.png

出力のLogの少し上の方に、警告が出た時ですが、
権限を与えすぎていて安全性が低い事原因だと思います。

プライベートキーファイルは、その他のすべてのユーザーの読み取りおよび書き込み操作から保護されている必要がある。
https://qiita.com/leomaro7/items/662699dcb7a7adc36f40

$ chmod 600 ~/.ssh/xxxxxxxxxxxx.pem

プライベートキーの記載されたファイルの、権限を変更してあげましょう。

終わり

接続後はVScodeの左下、こんな感じになると思います。

スクリーンショット 2021-09-13 23.15.30.png

2
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?