Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I login to a linux box with username user1 and my home folder is in /home. There is another user named user2 that has its home directory in /opt/data/folder.

If I want to check the list of users I inspect the file /etc/passwd in this simple way

grep user1 /etc/passwd
grep user2 /etc/passwd

I cannot find neither my user, not the other: Why is that? Is there any other file or command I should look to have a proper list of users?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

That is because the users database is stored elsewhere, for example an LDAP. Use getent passwd $USER to resolve your user. Make sure you read man nsswitch.con(5) to understand how and where can be users (and some other) databases stored.

share|improve this answer
    
My intention was to change the password of that user (via root) on that machine but it looks like I have to gather more information; seems that the user has not been added by doing the usual useradd , isn'it? –  Abruzzo Forte e Gentile Apr 9 '13 at 6:50
    
Exactly. Having root access to the machine doesn't imply you have admin access to an LDAP, though. –  dawud Apr 9 '13 at 7:00

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.