SSH service runs on 22 port number. You can change this port number for security. If you use Oracle Linux 7, Centos 7 or Red Hat Linux 7 versions, you can change port number with below operations. If selinux is enabled, you have to add new port number to selinux configuration because of the fact that selinux allows only 22 port number for ssh connections.
Step 1 : Change Port Number
[root #] vi /etc/ssh/sshd_config
Port 2290Save and Exit
Step 2 : Change Selinux Configuration
To change:
[root #] semanage port -a -t ssh_port_t -p tcp 2290
To list:
[root #] semanage port -l | grep ssh
Step 3 : Add New Port to Firewall
To Add:
[root #] firewall-cmd –permanent –zone=public –add-port=2290/tcp
To Activate
[root #] firewall-cmd –reload
Step 4 : Restart SSHD Service to Activate New SSH Confiuration
[root #] systemctl restart sshd.service
Step 5 : Show Running SSH Port
[root #] ss -tnlp | grep ssh
thanks for description.
i have oracle linux 6.8 and oracle 11
i did changes in sshd and firewall but my DB Admin can’t connect with new ssh port.
is need to configure oracle?
if yes what must we do?
thanks