Admin

User Administration

Add Users

$ useradd <username>

Make a Group

$ groupadd <groupname>

Make a User into a SuperUser

$ usermod -g wheel <username>

Get Information on a User

$ id <username>

Add User to Group

$ usermod -aG <groupname> <username>

Lock User Account

$ usermod -L <username>

Example: Web Admin Group

Setting up a user that can run a limited subset of commands with sudo, add a user to that group.

# Create a sudoers entry in the sudoers directory
$ sudo visudo -f /etc/sudoers.d/web_admin
# In the resulting file add the following to set the following allowed commands and user:
Cmnd_Alias WEB = /bin/systemctl restart httpd.service, /bin/systemctl reload httpd.service
<user> ALL=WEB

Secure Shell (SSH)

Generate a Key (on Control Station)

$ ssh-keygen

Copy the SSH key to a Workstation

$ ssh-copy-id <workstation_ip_or_localname>

Use SSH Agent for Persistent Key Usage

# Start your ssh agent
$ eval `ssh agent`
# Load your ssh private key
$ ssh-add <path to private key>

Last updated

Was this helpful?