Linux – What defines a user account?

Q. Can you tell us what defines a user account under Linux operating system?

A. Linux is multi-user system. This means more than one person can use the Linux. With the help of various software servers, configurations, and commands, multiple users can use Linux.

In order to gain access to the system and its resources, users are required to log in. By controlling access to system, you can prevent unauthorized users from using system as well as control access to data.

Most modern Linux distribution creates more than two user accounts when you install first time.

  • The first is root user. The root is superuser (you can compare this account with Administrator account under MS-Windows 2000/2003/XP server). The root has all rights to all files, system services, and softwares.
  • The second user is a normal (general-purpose) user account that you name. It has limited access to Linux.

More on root

Root account has full access to system so it is recommended that you do not use root it unless you have to. When you need to perform system level administrative task (such as adding new users, installing software etc) they you have to use the root account using su or sudo command. If you are new Linux, admin and use the root for all activity then senior (or coworkers) will make fun out of you.

Your /home directory

As soon as new user created, a home directory is automatically created for that user in /home directory. This is default location. However, in complex setup this location is changed according to organization requirements. For example, servers cluster hosting more than 2000 web site use following structure as a home directory:

Please note that the root user has its own home directory called /root.

Three files defines a user account

/etc/passwd file

ram:x:1003:1003:ram kumar:/home/ram:/bin/bash
charvi:x:1004:1004:charvi gite:/home/charvi:/bin/bash
vivek:x:1005:1005:vivek gite:/home/vivek:/bin/bash

/etc/group file


/etc/shadow file


For users to successfully log in, they must have a valid user name, password and other information defined in /etc/passwd and /etc/shadow files. The user may be granted additional access to additional groups on the system via /etc/group file. Almost all users have a home directory under /home, where user can store their personal data/files.

🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 1 comment so far... add one

CategoryList of Unix and Linux commands
Disk space analyzersdf ncdu pydf
File Managementcat cp mkdir tree
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
1 comment… add one
  • aref ghobadi Aug 27, 2015 @ 9:47

    thank you

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum