0
0

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 to connection to エラーの解決方法

Last updated at Posted at 2021-09-13

解決までの経緯

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

大前提として、
写真下部(写っていませんが出力欄)にLogが出力されていますので、そちらの内容を読み取れば答えが書いていました。

見方としては、写真の一番下More Actions...のボタンを押せば出力の画面が見れます。

💡解決方法(私の場合)

[20:40:57.919] Received install output: /Users/ユーザー名/.ssh/config line 5: garbage at end of line; "#".
[20:40:57.920] Failed to parse remote port from server output
[20:40:57.921] Resolver error: Error: 

"#"でコメントをいれていたので、それが原因でparseエラーになっていました。

そのため、.ssh/configのコメントを削除すると解決しました。

Host 任意の名前
  HostName [該当のIPアドレス]
  User root
  Port 22
  IdentityFile ~/.ssh/xxxxxxxxxxxxxxx # 秘密鍵が置いてあるパス ← こちらのコメント削除

この後、権限系のエラー

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

が出たので後述します。

その前にその他、試した事です。

試した事1:remotePlatformを指定

試した事2:「Remote.SSH: Config File」の設定

私はmacだったので、パスの部分C:\Users\<PCのユーザー名>\.ssh\config

User/<PCのユーザー名>/.ssh/config

と記載

試した事3:remote.SSH.useLocalServer を false に。

(番外)権限エラーの解決

別記事に記載しました。

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?