Linux User Management Cheat Sheet

Linux User Management Cheat Sheet

Get Social!

This is my cheat sheet on Linux user administration covering functions such as adding, and removing users and assigning them to groups.

Add a new Linux user

Use the useradd command to add a new user.

Change a users password

The user account is locked until you set a password with the passwd command.

Add user to group – new user

If you are adding a new user, you can add it to a group in the same command. This command will create a user of [USERNAME] in group [GROUPNAME].

Add user to group – existing user

If the user already exists, you can add it to an existing group with the usermod command.

Delete a user

Run the userdel command to remove an existing Linux user.

View existing users and groups

Run the below cat command to view existing Linux users. You sill see the user names and user IDs of all users on your server.

Use this cat command to view the existing Linux groups.

Change a users home directory location

You can change the users home directory with the usermod command.

Change a users UID

Use the usermod -u command to change the user ID of a user.

 


Related posts:


Leave a Reply

Visit our advertisers

Search

Quick Poll

Do you use ZFS on Linux?

Visit our advertisers