Raspberry Pi

How to Find User Account Information on Raspberry Pi

User accounts on any operating system resembles to a bridge connection between users and the device. To protect device and use only for specific person such as parent or child’s, users can create an account on the operating system. An account always consists of a username and user defined password for the user authentication.

If you are a Raspberry Pi user, and want to get user accounts information, then this article will be helpful for you.

Find User Account Information on Raspberry Pi

The user account information on Raspberry Pi can be accessed through different commands, which are shown below:

1: Use cat Command

The “/etc/password” file on Linux system includes the information of all accounts on the system including the system and normal users. The systems users are the built-in users accounts which are active for performing different activity on the system, such as updating packages, running background process and more.

To find the list all available accounts on the device, they can use the below-given command:

$ cat /etc/passwd

You are going to notice a lot of these account that you didn’t create appears after running of the command. That is just because, when you install some program, they create a user account on the device, so that they can run these programs on the device.

To figure out the real account that you use to login into the Raspberry Pi device, are those whose directory start with /home/pi. Below screenshot will highlight the listed user accounts that usually use to login.

Note: Those accounts ending with /bin/bash are the normal users account that are created on Raspberry Pi system.

You can also use the command in the following way to retrieve only the information of normal users on Raspberry Pi system.

$ cat /etc/passwd | grep home

2: lslogins Command

You can also use the lslogins command to find the normal users account information on Raspberry Pi system.

$ lslogins -u

3: getent Command

You can also use the getent command in the following way to find the user accounts on Raspberry Pi system:

$ getent passwd {1000..6000}

The same command can also use with a specific user account information in the following way:

$ getent passwd <username>

Conclusion

Multiple user accounts are associated with your Raspberry Pi system and to get the information about these accounts, you will see three different commands in the above-mentioned guidelines. These commands output the list of user’s accounts on the Raspberry Pi terminal.

About the author

Muhammad Nasir

Hi! I am an engineer and technical blogger by profession and I enjoy getting things done with electronics. I am using this platform to share my knowledge in the field of Raspberry Pi, Linux, and Embedded Systems with others.