![Linux 호스트에서 Virtual Box Windows 7 게스트로 SSH를 통해 어떻게 접속할 수 있나요?](https://rvso.com/image/1539551/Linux%20%ED%98%B8%EC%8A%A4%ED%8A%B8%EC%97%90%EC%84%9C%20Virtual%20Box%20Windows%207%20%EA%B2%8C%EC%8A%A4%ED%8A%B8%EB%A1%9C%20SSH%EB%A5%BC%20%ED%86%B5%ED%95%B4%20%EC%96%B4%EB%96%BB%EA%B2%8C%20%EC%A0%91%EC%86%8D%ED%95%A0%20%EC%88%98%20%EC%9E%88%EB%82%98%EC%9A%94%3F.png)
게스트에 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를 사용합니다. 그래서 저는 어느 쪽에서 연결을 설정하는지는 중요하지 않기 때문에 이를 사용하고 있습니다.