OCI: How to Enable Password Based Authentication on Ubuntu 22.04 Instance
in Linux
Applies To:
Oracle Cloud Infrastructure - Version Ubuntu 22.04 and later
Goal:
Enable password authentication on OCI Compute Ubuntu Instance.
Solution:
- Login to OCI Compute Linux (Ubuntu) instance
<ssh_clnt>$ ssh -i <PRIVATE_KEY> ubuntu@<UBUNTU_INSTANCE_IP_ADDRESS>
- Create a user for password authentication on that Ubuntu instance.
<ssh_serv>$ sudo useradd <USER_NAME>
Example) <ssh_serv>$ sudo useradd testuser
- Setup a password for the new user.
<ssh_serv>$ sudo passwd <USER_NAME>
Example)
<ssh_serv>$ sudo passwd testuser
- Backup and edit
/etc/ssh/sshd_config
to enablePasswordAuthentication
.
<ssh_serv>$ sudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config.backup
Tagged:
0