I asked this question in networking
, but it seems more appropriate in this forum.
I have a Linux server with static IP address, and I want to SSH/SMB to it.
In qemu it is easy with "-net user,net=192.168.136.0/24 -redir tcp:22:192.168.136.222:22 -redir tcp:445:192.168.136.222:445"
VirtualBox Host-only adapter also works after setting static IP address to it in the same network. Both SSH and SMB work fine in Windows7 host, but then it may conflict with my network, so I prefer using NAT instead and connect to localhost.
In Windows7 host if I do "VBoxManage.exe modifyvm "my server" --natpf1 "guestssh,tcp,127.0.0.1,2222,192.168.136.222,22", or equivalently use the dialog, then in Cygwin "ssh -v -p 2222 firstname.lastname@example.org" connects to the port but here is what I get:
OpenSSH_5.8p1, OpenSSL 0.9.8r 8 Feb 2011
debug1: Connecting to 127.0.0.1 [127.0.0.1] port 2222.
debug1: Connection established.
debug1: identity file /home/ehsan/.ssh/id_rsa type -1
debug1: identity file /home/ehsan/.ssh/id_rsa-cert type -1
debug1: identity file /home/ehsan/.ssh/id_dsa type -1
debug1: identity file /home/ehsan/.ssh/id_dsa-cert type -1
debug1: identity file /home/ehsan/.ssh/id_ecdsa type -1
debug1: identity file /home/ehsan/.ssh/id_ecdsa-cert type -1
ssh_exchange_identification: Connection closed by remote host
Since qemu as well as VirtualBox host-only adapter both work fine, SSH server (and root SSH access) should be working fine.
I tried turning off the firewall/add rules but it has same result.
I appreciate any insight, solution for similar problems, thanks