I need to be able to run SSH on port 23 instead of 22 on CentOS 6.5. SElinux won't allow that, as it has it as
tcp/23 defined in policy. Any steps on how can I go about changing service type from
Bratchley was on the right track. Indeed 'semanage' can change (modify) already defined ports.
Here's a way that worked for myself:
[root@host ~]# semanage port -l |grep ssh ssh_port_t tcp 22 [root@host ~]# semanage port -m -t ssh_port_t -p tcp 23 [root@host ~]# semanage port -l |grep ssh ssh_port_t tcp 23, 22
From here, you can modify SSHD to listen/use port 23 in /etc/ssh/sshd_config, restart the 'sshd' service and adjust your firewall as necessary.
I am no friend of SELinux, so this is just a wild guess: Modify /etc/services so that 23/tcp has the same entry as 22/tcp?