Changing SSH port for Oracle Cloud VM
1. Change Port number in sshd_config
$ sudo vi /etc/ssh/sshd_configPort <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.
Changing SSH port for Oracle Cloud VM
Reviewed by KimWorks
on
January 26, 2024
Rating: 5