Adding Users and Groups

Use the default opc user to add users and groups to a newly created instance.

We recommend that you create and configure users and groups according to their access requirements. Sign in to the instance as the opc user (see Accessing an Instance), and then add users and groups as necessary. See Create users and groups on Oracle Linux for a general introduction to users and groups on Oracle Linux.

The opc user

Oracle Linux instances have a default opc user. Use this account to create and configure other users and groups.

The opc account has:

  • Full sudo privileges.

  • No password by default.

    Instead you access the account over SSH with a key pair configured when you create the instance (see Accessing an Instance).

Adding a User

To add an account with the username alice to the system:

sudo useradd alice

To set a password for the user:

sudo passwd alice

Adding a Group

To add a group called staff to the system:

sudo groupadd staff

To add the user alice to the group staff:

sudo usermod -G staff alice

Manage the users in a group using the groupmems command. For example, to remove alice from the group staff:

sudo groupmems -d alice -g staff

Configuring Permissions

Define permissions by configuring users and groups within /etc/sudoers.

By default, members of the wheel group can use sudo to obtain all root privileges. You can add entries for users or groups by adding files to /etc/sudoers.d. For example, the privileges assigned to the opc user are defined in /etc/sudoers.d/90-cloud-init-users.