ssh: connect to host 10.0.2.15 port 22: Connection refused
35,763
Use ssh with port option:
ssh [email protected] -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 videos on Youtube
Author by
ebatinstitute
Updated on September 18, 2022Comments
-
ebatinstitute over 1 year
I have been trying the following command on the virtual machine in Ubuntu:
ssh [email protected]
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:
-
pa4080 over 7 yearsPlease edit your question and show us the content of
etc/ssh/sshd_config
.
-
-
ebatinstitute over 7 yearsI have one question ,why do you put -p 2222?
-
Ghasem Pahlavan over 7 yearsbecause your ssh server have listened on port 2222 but you connect to port 22.
-
Ghasem Pahlavan over 7 yearsyou can change your ssh server listening port in this file:
/etc/sshd/sshd_config ---> Port 22
and after that restart your ssh service.systemctl restart ssh