LKBEN11608: How to add an existing user to an existing group on Linux. (e.g. Kubuntu)


Symptom

You have a user with sudo right but he/she does not have all the rights.

Cause

This is by design and is the same for Debian, Ubuntu, Kubuntu etc.

Solution

To add an existing user to a group, you can use the usermod command instead of the useradd command.

sudo usermod -a -G cdrom useraccount

When you create a user and give the account sudo rights, you still need to add the account to some groups to have the full functionality.

The user still need the following groups: adm, cdrom, dip, plugdev, lpadmin lxd and sambashare.

To check if the user is added, you can list the groups of the user with the following command:

groups username

This shows all the groups the user is listed in.

Have fun.

Disclaimer:

The information provided in this document is intended for your information only. Lubby makes no claims to the validity of this information. Use of this information is at own risk!

About the Author

Author: Wim Peeters - Keskon GmbH & Co. KG

Wim Peeters is electronics engineer with an additional master in IT and over 30 years of experience, including time spent in support, development, consulting, training and database administration. Wim has worked with SQL Server since version 6.5. He has developed in C/C++, Java and C# on Windows and Linux. He writes knowledge base articles to solve IT problems and publishes them on the Lubby Knowledge Platform.

Latest update: 06-11-2022