ssh:connection refused

Issues related to configuring your network
Post Reply
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
Forum Moderator
Posts: 30366
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 died in November 2020 - migrate to a new version!
Info for USB installs on
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke

Post Reply

Return to “CentOS 6 - Networking Support”