Search code examples
sshcentos

CentOS 6.3. SSH. Bind to port xxx on 0.0.0.0 failed: Permission denied


CentOS 6.3 Minimal Configuration. Installed SSH Server, port 22. All works correctly. I change port 22 on 777 and restart sshd and see in logs:

Jul 26 01:01:07 myserver sshd[1590]: error: Bind to port 777 on 0.0.0.0 failed: Permission denied.
Jul 26 01:01:07 myserver sshd[1590]: error: Bind to port 777 on :: failed: Permission denied.
Jul 26 01:01:07 myserver sshd[1590]: fatal: Cannot bind any address.

/etc/sysconfig/iptables contains:

-A INPUT -m state --state NEW -m tcp -p tcp --dport 777 -j ACCEPT

netstat -tulpn | grep :22 and netstat -tulpn | grep :777 return nothing


Solution

  • Port 777 is dedicated for Multiling HTTP and even though not in use you can't bind to it. If you try for example to bind to port 8777 it will work just fine.