Have you ever been sifting through your log files, and seen this little jewel:
Now are we listing on port 22 or not? I know I am logged in via ssh right now, so I know sshd is working correctly. Lets do a little investigation shall we? Lets see what is listing on port 22.
[server][root][~]# netstat -an | grep 22 tcp 0 0 :::22 :::* LISTEN [server][root][~]# lsof -i | grep 22 sshd 3449 root 3u IPv6 7505 TCP *:22 (LISTEN)
Ahhhh HA! Just as I suspected, IPv6 is listening on port 22 so IPv4 can’t listen on port 22. Whew. I thought there might be something really serious going on.
Open up /etc/ssh/sshd_config in your favorite text editor and slap this snippet (or uncomment it if it is already there) into it.
ListenAddress 0.0.0.0
If you have this in your sshd_config, make sure that it is commented like so, by putting a hash (#) in front of it.
#ListenAddress ::
That should do it… restart sshd and that should take care of that little error… errrrr I mean jewel :-)
You can also disable IPv6 instead, but that's taking things a little bit far if you ask me.
echo "alias net-pf-10 off" >> /etc/modprobe.conf
If you do disable IPv6, don’t forget to restart your server.

