Ubuntu – ssh: connect to host 10.0.2.15 port 22: Connection refused

command lineopensshssh

I have been trying the following command on the virtual machine in Ubuntu:

ssh root@10.0.2.15

But I keep in getting this response :

ssh: connect to host 10.0.2.15 port 22: Connection refused

I have checked my ssh status with this command :

service sshd status

And I got this result back:

Screenshot showing, among other information, "Server listening on :: port 22"

Best Answer

Use ssh with port option:

ssh root@10.0.2.15 -p 2222

Edit

This issue happens when you change your ssh server port to a non standard port like 2222 in ssh config file. (/etc/ssh/sshd_config --> Port 2222)

Related Question