Innovate | Connect | Transform
ContactService statusUSD $

GICT knowledge base

The Ultimate User Management Guide for Ubuntu Servers

Published

Linux and Commands

User management is one of the first things you need to learn when working with Ubuntu servers. Good user management keeps your server safe and makes sure that only the right people have access to important files and commands. In this guide, you will find clear instructions for handling users and groups, from adding new users to removing them, as well as managing permissions, passwords, and common rules that keep your system secure. Everything is explained in plain language, with only a few technical terms where needed.

What Are Users and Groups?

Every person or program that uses an Ubuntu server needs a user account. User accounts let the system know who is requesting access. Each user can belong to one or more groups. Groups make it easy to give lots of users the same permissions at once. For example, you can add all developers to the developers group, and then allow that group to edit files in a project folder.

Types of Users

  • Root user: The superuser with full control. This account can do anything, including serious changes. For safety, it’s better to use sudo with a regular user account to perform admin tasks, instead of logging in as root directly.
  • Regular users: People who need access to the server’s resources. Their permissions are limited based on group membership.
  • System users: Accounts used by software or services running in the background. These usually don’t have passwords for logging in.

Adding a New User

When you want to let someone use the server, start by creating their user account. Open a terminal and enter:

sudo adduser alice

This command creates a user named “alice”. You will be asked to set a password and can also enter optional info like their real name or phone number. If you don’t want to enter this, just press Enter to continue past each prompt. A home directory will be created at /home/alice.

Tip: Always use strong passwords for every user. This helps keep your server safe from unauthorized access.

Giving Sudo Privileges

Sometimes, users need to perform actions that change system settings or install software. That’s where sudo comes in. If you want to make “alice” able to run admin commands:

sudo usermod -aG sudo alice

The -aG flags mean “append the user to a group,” and the group is sudo. After this, “alice” will be able to use sudo at the start of commands when needed.

If you want not provide sudo privileges to any user anymore, You can just remove the user from sudo group and user won’t be able to execute any command with sudo privileges.

Listing All Users

To see who has accounts on your system, look at the /etc/passwd file:

cat /etc/passwd | grep '/home'

This command lists every user that has a home folder, which usually means human users. System users often don’t have home folders.

Changing and Resetting Passwords

Passwords may need to be changed for safety or if the user forgets. To change a password for “alice”:

sudo passwd alice

You’ll be asked to enter a new password twice. Always choose secure passwords that no one else can guess.

Removing Users from the Server

If someone leaves your team, it’s critical to remove their account right away. To remove “alice”:

sudo deluser alice

This deletes the account but leaves the user’s home directory behind in case you need their files later. To delete the account and home directory:

sudo deluser --remove-home alice

Managing Groups

Groups let you set up roles on your server. To create a new group called “devs”:

sudo addgroup devs

Add a user to the “devs” group:

sudo usermod -aG devs alice

You can put several users in a group. Use groups alice to check which groups a user is in. To remove a user from a group, try:

sudo deluser alice devs

Understanding Permissions

Every file and folder on Ubuntu has permissions for who can read, change, or run it. Users have ownership rights, and groups can be given special access too. To check permissions on a file, type:

ls -l /path/to/file

The output shows who owns the file and what they and others can do with it. Change ownership with chown and permissions with chmod as needed. For example, give the “devs” group ownership of the project folder:

sudo chown -R :devs /srv/project

Disabling Accounts without Deleting

If you want to stop someone from logging in but don’t want to delete their files or account, you can lock their account:

sudo usermod --lock alice

Unlock the account later with:

sudo usermod --unlock alice

Security Tips for Ubuntu User Management

  • Only use sudo when you really need to. Too many admin users can cause mistakes and security gaps.
  • Review user and group lists often. Remove accounts and groups you do not need anymore.
  • Change passwords regularly—every few months is a good habit.
  • Set up SSH key authentication for stronger security, and turn off password login where you can.
  • If you allow remote connections, always use strong firewall rules and limit access by IP address when possible.
  • Consider using the last and who commands to see login history, so you catch any suspicious activity early.

Conclusion:

Without strong user management, any Ubuntu server can become a security risk. Someone could stay on your system long after leaving your team. Permissions may be too open, giving people the ability to accidentally delete files or view private data. By following good user and group practices, you’ll make your Ubuntu server safer, more organized, and easier to manage over the long run.

User management may look tricky at first, but it quickly becomes easy with regular practice. The key commands—like adduser, deluser, usermod, and groups—should become part of every admin’s toolkit. Make a habit of checking who has access, keep your group memberships in order, and lock or remove accounts as soon as they are no longer needed.

With these tips, you’ll have more confidence in running your Ubuntu server, knowing that you are in control of who can use it and what they can do. Good user management is the foundation of any secure server—start mastering it today.

Related guides

Account services are unavailable until the production backend is configured.