VisualStudioからDockerコンテナにリモート接続できない

実現したいこと

BSDソケットを使ったサーバプログラムをWindows環境で開発したいので、DockerでCentOS7のコンテナを建て、VisualStudio2019からリモートデバッグしようと考えています。

参考サイト:

https://tech-walkit-net.cdn.ampproject.org/v/s/tech.walkit.net/docker-visual-studio-linux?amp=1&amp_gsa=1&amp_js_v=a9&usqp=mq331AQIUAKwASCAAgM%3D#amp_tf=%251%24s%20%E3%82%88%E3%82%8A&aoh=17143805334984&referrer=https%3A%2F%2Fwww.google.com&ampshare=https%3A%2F%2Ftech.walkit.net%2Fdocker-visual-studio-linux

https://learn.microsoft.com/ja-jp/cpp/linux/connect-to-your-remote-linux-computer?view=msvc-160#host-key-verification

発生している問題・分からないこと

Putty,WinSCPではコンテナとの接続ができるのですが、VisualStudioでの接続時、30秒くらい接続テストをした後ログからエラーが出力されます。
これは、SSH キー交換の検証に失敗が原因で接続できていない認識で大丈夫でしょうか?

また、VisualStuidoはパスワード認証で接続しているのですが、その際
「ホスト '127.0.0.1' の信頼性を確立する必要があります。
ecdsa-sha2-nistp256 キーのフィンガープリントは SHA256:xxxx です。」
と書かれたウィンドウが出るのですが、これは接続するユーザのホームディレクトに.sshディレクトリを作成し、その中にウィンドウのフィンガープリントに対応する公開鍵を置く認識で問題ないでしょうか?

ご教示お願い致します。

イメージ説明

エラーメッセージ

error

115:58:42.3452752 [Info, Thread 1] liblinux.RemoteSystemBase: Connecting over SSH to 127.0.0.1:2222 215:58:42.4405232 [Info, Thread 63] liblinux.HostKeyVerifier: Host key fingerprint not initialized for host '127.0.0.1'. Host reports fingerprint: SHA256:xxxxx. 315:58:42.6134188 [Error, Thread 1] liblinux.RemoteSystemBase: Connection failure over SSH to 127.0.0.1:2222 415:58:42.6154194 [Error, Thread 1] liblinux.RemoteSystemBase: liblinux.RemoteConnectivityException: SSH キー交換の検証に失敗しました。 ---> Renci.SshNet.Common.SshKeyExchangeFailedConnectionException: 種類 'Renci.SshNet.Common.SshKeyExchangeFailedConnectionException' の例外がスローされました。 5 場所 Renci.SshNet.Session.WaitOnHandle(WaitHandle waitHandle, TimeSpan timeout) 6 場所 Renci.SshNet.Session.WaitOnHandle(WaitHandle waitHandle) 7 場所 Renci.SshNet.Session.Connect() 8 場所 Renci.SshNet.BaseClient.CreateAndConnectSession() 9 場所 Renci.SshNet.BaseClient.Connect() 10 場所 liblinux.HostKeyVerifier.Connect(BaseClient client) 11 --- 内部例外スタック トレースの終わり --- 12 場所 liblinux.HostKeyVerifier.Connect(BaseClient client) 13 場所 liblinux.RemoteSystemBase.ConnectCore() 1415:58:42.6179278 [Info, Thread 1] liblinux.RemoteSystemBase: Disconnecting over SSH from "127.0.0.1:2222" 1515:58:44.7298993 [Info, Thread 1] liblinux.RemoteSystemBase: Connecting over SSH to 127.0.0.1:2222 1615:59:11.5106366 [Info, Thread 1] liblinux.IO.RemoteFileSystemImpl: Connecting over SFTP to 127.0.0.1:2222 1716:00:24.0606757 [Error, Thread 1] liblinux.Shell.CommonCommandBase: コマンド 'echo $0' の実行がタイムアウトしました。17318.7124 ミリ秒待機しました。 1816:00:24.0618308 [Info, Thread 1] liblinux.Shell.CommonCommandBase: Command "echo $0" finished with exit code -1 after 17319.4107ms 1916:00:24.0618308 [Info, Thread 1] liblinux.RemoteSystemBase: Disconnecting over SSH from "127.0.0.1:2222" 2016:00:24.0639300 [Info, Thread 1] liblinux.IO.RemoteFileSystemImpl: Disconnecting over SFTP from 127.0.0.1:2222

該当のソースコード

特になし

試したこと・調べたこと

上記の詳細・結果

ログのようなエラーを調べても解決方法が出てきませんでした

補足

特になし

コメントを投稿

0 コメント