×

This article covers different methods to add or delete the user in your Linux Mint system. For adding new users in system there are two commands available in your system, useradd and adduser. adduser command is the enhanced version of the useradd command. adduser command uses useradd command in the backend.



This article covers how to change own and another user account passwords. It's recommended that to change your password frequently and use a unique password for each account for security purpose. Basically, you will learn how to change a password on any Linux distribution, including Ubuntu, Debian, and CentOs.

To change a password on behalf of a user, first sign on or "su" to the "root" account. Then type, ``passwd user'' (where user is the username for the password you are changing). The system will prompt you to enter a password. Passwords do not echo to the screen when you enter them.

You can also change your own password, by typing ``passwd'' (without specifying a username). You will be prompted to enter your old password for verification, and then a new password.


How to Change a Password in Linux?

To change the password in Linux you need to open the terminal and type the following command:

$ sudo passwd

After executing the command, you will be asked to enter the new password twice. 



This article covers how to list users in Linux system and also differentiate difference between normal user and system user. Linux OS is unique because of its multi-user characteristic allowing multiple users on one system, at the same time. However, tracking all users is essential. The /etc/passwd file contains one line for each Linux user account, with seven fields delimited by colons. This is a text file. You can easily list users under Linux using the cat command or other commands such as grep command / egrep command and more. With this same approach, you can use the Linux commands to list all users on all Linux operating system, including Ubuntu, Debian, RHEL, Arch, Fedora, CentOS, and other distros.


To list all users on Linux, use the cat command as follows:

$ cat /etc/passwd



This article covers how you can change user password in Linux either graphically or using the command line. Both Linux and UNIX-like operating systems use the passwd command to change user password. 

This applies to any Linux distribution, including Alpine, Arch, Ubuntu, Debian, RHEL, Fedora, Oracle CentOS, SUSE/OpenSUSE and other popular Linux distros.

The passwd is used to update a user's authentication token (password) stored in /etc/shadow file. 


To Set User Password in Linux:

Type following passwd command to change your own password:

$ passwd


To see all user account try grep command or cat command as follows:

$ cat /etc/passwd
$ grep '^userNameHere' /etc/passwd
$ grep '^linuxapt' /etc/passwd



This article covers how to add a user to a group on Ubuntu Linux System. If you want to learn about adding or removing a user on Linux OS, you can follow our guide on How to Add and Remove Users on Linux .

User accounts can be assigned to one or more groups on Linux. You can configure file permissions and other privileges by group. For example, on Ubuntu, only users in the sudo group can use the sudo command to gain elevated permissions.


To Add a New Group on Ubuntu Linux:

If you want to create a new group on your system, use the groupadd command following command, replacing new_group with the name of the group you want to create:

$ sudo groupadd mynewgroup


To Add an Existing User Account to a Group:

To add an existing user account to a group on your system, use the usermod command, replacing examplegroup with the name of the group you want to add the user to andexampleusername  with the name of the user you want to add:

$ usermod -a -G examplegroup exampleusername



This article covers how to take Backups and restore a MySQL database on Red Hat Enterprise Linux 8.


Advantage of logical backup:

The main advantage of logical backup over physical backup is portability and flexibility. 

The data can be restored on other hardware configurations, MariaDB versions or Database Management System (DBMS), which is not possible with physical backups.

Note that physical backup must be performed when the mariadb.service is not running or all tables in the database are locked to prevent changes during the backup.


The mysqldump client is a backup utility, which can can be used to dump a database or a collection of databases for the purpose of a backup or transfer to another database server. 

The output of mysqldump typically consists of SQL statements to re-create the server table structure, populate it with data, or both. 

Alternatively, mysqldump can also generate files in other formats, including CSV or other delimited text formats, and XML.


Advantages of Physical backup:

1. Output is more compact.

2. Backup is smaller in size.

3. Backup and restore are faster.

4. Backup includes log and configuration files.


You can use one of the following MariaDB backup approaches to back up data from a MariaDB database:

1. Logical backup with mysqldump

2. Physical online backup using the Mariabackup tool

3. File system backup

4. Replication as a backup solution


To Backing up an entire database with mysqldump:

Execute the command:

# mysqldump [options] db_name > backup-file.sql


Using mysqldump to back up a set of tables from one database:

To back up a subset of tables from one database, add a list of the chosen tables at the end of the mysqldump command:

# mysqldump [options] db_name [tbl_name …​]



To restore the data while keeping the original backup files, use the following procedure:

1. Run the mariabackup command with the --copy-back option:

$ mariabackup --copy-back --target-dir=/var/mariadb/backup/

2. Fix the file permissions.

When restoring a database, Mariabackup preserves the file and directory privileges of the backup. However, Mariabackup writes the files to disk as the user and group restoring the database. 

For example, to recursively change ownership of the files to the mysql user and group:

# chown -R mysql:mysql /var/lib/mysql/

3. Start the mariadb service:

# systemctl start mariadb.service



This article covers how you can easily find out which groups a user belongs to in Ubuntu. Also we shared how to list all groups in a system, list members of a group, add and remove a user from the group. For information about adding/removing users in a system, visit our guide on how to add and remove users on Ubuntu .

Adding a user to an existing group is one of the typical tasks of a Linux administrator.

A group is a collection of users. 

The main purpose of the group is to define a set of privileges to their members within the group.


To find out if a user has sudo access is by checking if the said user is member of the sudo group. 

If you see the group 'sudo' in the output, the user is a member of the sudo group and it should have sudo access.

In order to list groups on Linux, you have to execute the "cat" command on the "/etc/group" file. 

When executing this command, you will be presented with the list of groups available on your system.


To login as Sudo on Ubuntu:

1. Open a terminal Window. Press Ctrl + Alt + T to open the terminal on Ubuntu.

2. To become root user type: sudo -i. sudo -s.

3. When promoted provide your password.

4. After successful login, the $ prompt would change to # to indicate that you logged in as root user on Ubuntu.


What is /etc/passwd file?

"/etc/passwd" is a text file containing every user information that is required to login to the Linux system. It maintains useful information about users such as username, password, user ID, group ID, user information, home directory and shell.


To find out which groups a user belongs to in Linux:

1. groups: Show All Members of a Group.

2. id: Print user and group information for the specified username.

3. lid or libuser-lid: It display user's groups or group's users.

4. getent: Get entries from Name Service Switch libraries.

5. compgen: compgen is bash built-in command and it will show all available commands for the user.

6. members: List members of a group.

7. /etc/group file: Also, we can grep the corresponding user’s groups from the /etc/group file.


What is Wheel Group in Linux?

The wheel group is a special user group used on some Unix systems, mostly BSD systems, to control access to the su or sudo command, which allows a user to masquerade as another user (usually the super user). Debian-like operating systems create a group called sudo with purpose similar to that of a wheel group.


Types of groups in Linux:

1. Primary Group - The primary group is the main group associated with the user account. Each user must be a member of a single primary group.

2. Secondary Group - The secondary or supplementary group is used to grant additional rights to the user. Each user can become a member of multiple secondary groups.



This article covers how you can add and remove users on Ubuntu and assign them administrator privileges. Based on your convenience, you can either choose to add and remove users either through the command line or GUI. 

Ubuntu, like any other Linux distribution, is a multi-user operating system. Each user can have different permission levels and specific settings for various command-line and GUI applications.

Knowing how to add and remove users is one of the basic skills a Linux user should know.


To add a user in Ubuntu via GUI:

1. Open the Activities overview and start typing Users.

2. Click on Users to open the panel.

3. Press Unlock in the top right corner and type in your password when prompted.

4. Press the + button, below the list of accounts on the left, to add a new user account.


To remove a user from Ubuntu:

1. Open the terminal app.

2. Login to server using the ssh user@server-ip-here command.

3. Run sudo deluser --remove-home userNameHere command to delete a user account on Ubuntu.

4. Verify it by running id command.


To Remove a Linux user:

1. Log in to your server via SSH.

2. Switch to the root user: sudo su -

3. Use the userdel command to remove the old user: userdel user's username.

Optional: You can also delete that user's home directory and mail spool by using the -r flag with the command: userdel -r user's username.


To Add a User to Linux:

1. Log in as root.

2. Use the command useradd "name of the user" (for example, useradd linuxapt)

3. Use su plus the name of the user you just added to log on.

4. "Exit" will log you out.


Linux operations commands:

1. adduser : add a user to the system.

2. userdel : delete a user account and related files.

3. addgroup : add a group to the system.

4. delgroup : remove a group from the system.

5. usermod : modify a user account.

6. chage : change user password expiry information.


How do I assign a user to a group in Linux?

1. To create a new group, enter the following: sudo groupadd new_group.

2. Use the adduser command to add a user to a group: sudo adduser user_name new_group.

3. To delete a group, use the command: sudo groupdel new_group.

4. Linux comes with several different groups by default.



This article will guide you on how you can log out from your Debian 10 system. Here, you will learn the different methods of logging out of a #Debian system. 

exit command in #linux is used to exit the shell where it is currently running. 

It takes one more parameter as [N] and exits the shell with a return of status N. 

If n is not provided, then it simply returns the status of last #command that is executed. Syntax: exit [n].

pkill is a command-line utility that sends signals to the processes of a running program based on given criteria. 

The processes can be specified by their full or partial names, a user running the process, or other attributes.



This article will guide you on different methods to log out of the #CentOS 8 #Linux system. Therefore, If you want to close the current user session then, Logging out of the system is the best choice. 

The main difference between these tools is that kill terminates processes based on Process ID number (PID), while the killall and pkill commands terminate running processes based on their names and other attributes.

To exit CentOS 7:

i. Simply use 'Ctrl-C' to kill terminal commands in linux. 

ii. Ctrl-D should be used to terminate nl correctly. 

iii. Ctrl-C is just a general way to kill #applications.



This article will guide you on the different methods to list down all the Linux system users. To know whether a particular user is having sudo access or not, we can use -l and -U options together. For example, If the user has sudo access, it will print the level of #sudo access for that particular user. 

If the user don't have sudo access, it will print that user is not allowed to run sudo on localhost.

To change users in #Linux:

The su command lets you switch the current user to any other user. 

If you need to run a command as a different (non-root) user, use the –l [username] option to specify the user account. 

Additionally, su can also be used to change to a different shell interpreter on the fly.




More Linux Tutorials

We create Linux HowTos and Tutorials for Sys Admins. Visit us on IbmiMedia.com

Also for Tech related tips, Visit forum.outsourcepath.com or General Technical tips on www.outsourcepath.com