When we create the Oracle Compute instance (Linux/Window), by default OPC user is created and it has sudo privileges on linux and add user account privileges on Windows instance
To create an additional SSH-enabled user on Linux Compute instance
1.Generate an SSH key pair for the new user.
- Copy the public key value to a text file for use later in this procedure.
- Log in to your instance using the OPC user
- Become the root user:
- Create the new user:
- Create a .ssh directory in the new user’s home directory:
- Copy the SSH public key that you saved to a text file into the /home/new_
echo <public_key> > /home/<new_user>/.ssh/authorized_keys
- Change the owner and group of the /home/username/.ssh directory to the new user:
chown -R <new_user>:<group> /home/<new_user>/.ssh
- To enable sudo privileges for the new user, run the vi sudo command and edit the
/etc/sudoers file as follows:
In /etc/sudoers, look for:
%<username> ALL=(ALL) NOPASSWD: ALL
Add the following line immediately after the preceding line:
%<group> ALL=(ALL) NOPASSWD: ALL
Creating Additional Users on a Windows Instance
- Log in to your instance using a Remote Desktop client.
- On the Start menu, click Control Panel.
- Click User Accounts, and then click User Accounts again.
- Click Manage User Accounts.
- Click Manage Another Account.
- Click Add User Account.
- Enter a User name and Password.
- Confirm the password, and then create a Password hint.
- Click Next.
- Verify the account, and then click Finish.
You can now log in as the new user.