ssh:connection refused

Issues related to configuring your network
Post Reply
prsdan
Posts: 1
Joined: 2020/01/19 09:32:56

ssh:connection refused

Post by prsdan » 2020/01/19 09:37:16

I wanna ssh localhost
but after I use this command it will return this error message
ssh: connect to host localhost port 22: Connection refused

I tried to open this port
but apparently 22 is not in ports that are listening I don't know what to do?

User avatar
TrevorH
Forum Moderator
Posts: 27727
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: ssh:connection refused

Post by TrevorH » 2020/01/20 14:04:59

If port 22 does not show up in the output from netstat -antup | grep :22 then your ssh daemon is either not running or is not listening on port 22 (on localhost). Or you've deleted the line from the default iptables config that allows all connections on -i lo.
CentOS 6 will die in November 2020 - migrate sooner rather than later!
CentOS 5 has been EOL for nearly 3 years and should no longer be used for anything!
Full time Geek, part time moderator. Use the FAQ Luke

Post Reply

Return to “CentOS 6 - Networking Support”