OCI: How To Change ssh Port Number in Ubuntu
Applies To:
Oracle Cloud Infrastructure
Ubuntu OS
Goal:
This document explains steps to change the ssh port number of an Ubuntu instance from Port 2222 to 22.
Solution:
- Login to the instance if possible via ssh.
- If ssh is not possible due to error “
No route to host
” , then follow the steps in this document to mount the boot volume on another working Instance. - Once the boot volume is mounted on a working instance, perform the following below to change the port number:
$ vi /etc/ssh/sshd_config
Port 22
- Save the file and run the command below:
$ sudo update-grub
- Exit from
chroot
Tagged:
0