0

I installed Virtual Box on my Linux OS, in the Virtual Box, I created another Linux OS, which has a user called "dvader", I want to SSH from my local Linux OS to the Linux OS on Virtual Box, I used the command below:

$ ssh -p 2222 dvader@localhost

But I always got the error:

ssh: connect to host localhost port 2222: Connection refused

Anyone knows how to solve this problem? Thank you in advance.

betteroutthanin
  • 7,148
  • 8
  • 29
  • 48

1 Answers1

0

cuestion: ¿are you using NAT?... SSH listen p22 by default, if you want connection on p2222 edit the ssh_config placed in /etc/ of your VM Guest... find the line (assuming that you are in a *buntu OS family)

 39 #   Port 22

and change it to

 39    Port 2222

and there you have it on p2222

BTW, your host could'nt see the guest by name "dvader@localhost", because "localhost" it's indeed your HOST & your GUEST maybe another IP, give more details about your VNetwork config...

Sorry for my english :)

  • Hi, what do you mean by `39 # Port 22`? It is a command? – betteroutthanin Apr 08 '14 at 15:16
  • 39 is the line number on the ssh_config file... EDIT: now i see your edit... the user dvader is on the admin group ¿? – victorjordan Apr 08 '14 at 16:17
  • Sorry for pointing you to wrong direction, [here](http://stackoverflow.com/questions/5906441/how-to-ssh-to-a-virtualbox-ubuntu-guest-externally-through-a-windows-host) you can see how to doit in a clean way, other [link](https://forums.virtualbox.org/viewtopic.php?f=8&t=55766) from de the vbox forum... – victorjordan Apr 08 '14 at 16:28