Changing SSH port for Oracle Cloud VM

 





1. Change Port number in sshd_config

$ sudo vi /etc/ssh/sshd_config

Port <new port>

$ sudo systemctl restart ssh


2. Change IPTables entry

$ sudo vi /etc/iptables/rules.v4

-A INPUT -p tcp -m state --state NEW -m tcp --dport <new port> -j ACCEPT

$ sudo iptables-restore < /etc/iptables/rules.v4


3. Change in Security List

Go to Security List for that VCN and Subnet.  Add <new port> with TCP protocol.



No comments:

Powered by Blogger.