0

I went to Devices -> Network Adapters.. -> Port Forwarding and added the following:

Name: SSH Protocol: TCP Host IP: 127.0.0.1 (I also tried blank) Host Port: 22 Guest IP: 127.0.0.1 (I tried blank here as well) Guest Port: 4022

I then tried the following via my Ubuntu virtual machine:

sftp -oPort=4022 username@127.0.0.1

And I got the following:

ssh: connect to host 127.0.0.1 port 4022: Connection refused
Couldn't read packet: Connection reset by peer

I can connect to the host from the host via port 22 just fine. I allowed port 22 in the firewall but that doesn't seem to do anything either.

Any ideas?

migrated from stackoverflow.com Mar 31 '14 at 18:23

This question came from our site for professional and enthusiast programmers.

1

Name: SSH Protocol: TCP Host IP: 127.0.0.1 (I also tried blank) Host Port: 22 Guest IP: 127.0.0.1 (I tried blank here as well) Guest Port: 4022

This sets up a port forward from the host to the guest, not the other way around. It would accept connections to port 22 on the host, and forward those connections to port 4022 on the guest.

If you want to connect from the guest to the host, just connect to the host's regular LAN IP address, whatever that is.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.