Linux ホストから Virtual Box Windows 7 ゲストに SSH 接続するにはどうすればよいでしょうか?

Linux ホストから Virtual Box Windows 7 ゲストに SSH 接続するにはどうすればよいでしょうか?

ゲストに Cygwin をインストールし、sshd を設定しました。ssh localhostゲスト内から実行できます。

仮想マシンは「NAT」アダプタに接続されており、仮想マシンのポート転送ルールを次のように設定しました。

TCP 127.0.0.1 6666 10.0.2.15 22

しかし、Linuxホストから次のように接続しようとすると、

$ ssh  -v -p 6666 [email protected]
OpenSSH_6.6.1, OpenSSL 1.0.1f 6 Jan 2014
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to 127.0.0.1 [127.0.0.1] port 6666.
debug1: Connection established.
debug1: identity file /home/pjmp/.ssh/id_rsa type 1
debug1: identity file /home/pjmp/.ssh/id_rsa-cert type -1
debug1: identity file /home/pjmp/.ssh/id_dsa type -1
debug1: identity file /home/pjmp/.ssh/id_dsa-cert type -1
debug1: identity file /home/pjmp/.ssh/id_ecdsa type -1
debug1: identity file /home/pjmp/.ssh/id_ecdsa-cert type -1
debug1: identity file /home/pjmp/.ssh/id_ed25519 type -1
debug1: identity file /home/pjmp/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.8

コマンドはこの出力でハングします。何が間違っているのでしょうか?

答え1

NAT インターフェイスは、仮想マシンでの非常に単純なインターネット接続以外ではほとんど役に立ちません。インターフェイスをブリッジして LAN 上でアドレス指定可能な IP を取得するか、プライベート インターフェイスを使用するか、NAT と他のインターフェイスのいずれかを組み合わせて使用​​します。

答え2

逆に、cygwin から Linux ホストに ssh すると正常に動作することがわかりました。どちら側から接続を確立しても問題ないため、これを使用しています。

関連情報