Fli
02-28-2020, 09:29 PM
I tried to change SSH port by editting file /etc/ssh/sshd_config
and then "service sshd reload", but the "netstat -tlnp" not shown any opened port by SSH and "service sshd status" shown not running SSH "(code=exited, status=255)"
tail -n 100 /var/log/secure
shown:
sshd[8712]: error: Bind to port 7777 on :: failed: Permission denied.
sshd[8712]: fatal: Cannot bind any address.
When i searched for the "(code=exited, status=255)" someone suggested that the cause is SELinux.
And following command worked to set new SSH port 7777:
semanage port -a -t ssh_port_t -p tcp 7777 &
and then "service sshd reload", but the "netstat -tlnp" not shown any opened port by SSH and "service sshd status" shown not running SSH "(code=exited, status=255)"
tail -n 100 /var/log/secure
shown:
sshd[8712]: error: Bind to port 7777 on :: failed: Permission denied.
sshd[8712]: fatal: Cannot bind any address.
When i searched for the "(code=exited, status=255)" someone suggested that the cause is SELinux.
And following command worked to set new SSH port 7777:
semanage port -a -t ssh_port_t -p tcp 7777 &