Skip to content

getent command on Linux (change property)

The getent command on Linux is used to access databases of user accounts, passwords, and user groups.

Only the databases configured in the /etc/nsswitch.conf file can be accessed with this command.

The command syntax is:

$ getent key database

The database may assume the following values:

  • passwd: refers to the /etc/passwd file;
  • shadow: refers to the /etc/shadow file;
  • group: refers to the /etc/group file;

The key is the item where you want information from the database.

See the example, it shows the zabbix user account data:

$ getent passwd zabbix zabbix:x: 500:501: :/home/zabbix: /bin/bash

Only root can access the shadow database:

# getent shadow zabbix zabbix: $6$.. 5pdu8/$sboejzwpye3hrnhopi8pjw5rppm2eeqc3oywgaqfajwjsaoy xqmgs9bylcnitkk.su.oqcuSEWRUEPOAUZFQ0.: 16537:0:99999:7: :16509:

The getnet command is useful for taking data from a particular user account or group, without having to list the contents of the passwd, shadow, or group files and filter the results with grep.

Are you an IT professional, support professional, or developer, have you ever considered learning Linux for real?

Is it still bad to get an LPI Linux Essentials certification from breaking?

And even better, with the best online course for Linux?

[RICH_REVIEWS_SHOW CATEGORY=“Course” num=“all “]

Do like these people and create your account now.

Here you have everything you need to succeed in the LPI and CompTIA exams

  • Practical Classes at Shell
  • Flashcards for memorization
  • Crossword Games
  • 06 virtual servers on Amazon just for you
  • Mind Maps
  • Video Glossary
  • Preparatory simulation for the exams
  • Personalized class schedule
  • Guided exercises — Real Laboratories
  • Lesson Resources (notes and others)

Do you want to know if a certification is worthwhile? Learn why salaries are good, and why companies are looking for Linux professionals.

You’ll understand that the benefits far outweigh the sacrifice.

And if you’ve made up your mind, check out our Certification Guide.

And if you want to know where to take the tests, check the list of cities.

If you want to know the language of the exams, check out this post.

Learn much more about Linux in our online course. You can register here. If you already have an account, you can log in here.

Did you like it? Share