ssh: connect to host 127.0.0.1 port 22: Connection refused

Discussions related to using VirtualBox on Linux hosts.
Post Reply
freeneutron
Posts: 3
Joined: 19. Oct 2015, 12:59

ssh: connect to host 127.0.0.1 port 22: Connection refused

Post by freeneutron »

General system: Ubuntu 14.04
Guest system: Centos 6
Attempt to connect via ssh as end:
freeneutron@freeneutron-A780L3L:~$ ssh 127.0.0.1
ssh: connect to host 127.0.0.1 port 22: Connection refused
freeneutron
Posts: 3
Joined: 19. Oct 2015, 12:59

Re: ssh: connect to host 127.0.0.1 port 22: Connection refus

Post by freeneutron »

port 22 was forwarded in accordance with instructions
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: ssh: connect to host 127.0.0.1 port 22: Connection refus

Post by Perryg »

Ports below 1024 can not be forwarded on a Linux host. Also the guest needs to have ssh available and properly configured for it to work. CentOS has firewall rules to prevent it by default.
freeneutron
Posts: 3
Joined: 19. Oct 2015, 12:59

Re: ssh: connect to host 127.0.0.1 port 22: Connection refus

Post by freeneutron »

I replaced the port 22 to 2222. And it worked immediately.
Thank you very much for your help!
Post Reply