Personal computing discussed

Moderators: SecretSquirrel, notfred

 
flip-mode
Gerbil Khan
Topic Author
Posts: 9322
Joined: Thu May 08, 2003 12:42 pm
Location: Cincinnati, OH

Linux - display all user info

Mon Feb 28, 2011 3:50 pm

Is there a command to display all the info about a user - home directory, etc.

Reason I ask: I just installed vsftpd and the Ubuntu documentation says that by default the installer creates user 'ftp' and creates a home directory '/home/ftp' for that user. Well, the user 'ftp' was indeed added to the system, but there is no '/home/ftp' directory. So, now I'm wondering exactly what the ftp user's profile parameters are. I guess I'm looking for something like a hypothetical:

usermod --list ftp
 
just brew it!
Gold subscriber
Administrator
Posts: 44200
Joined: Tue Aug 20, 2002 10:51 pm
Location: Somewhere, having a beer

Re: Linux - display all user info

Mon Feb 28, 2011 6:17 pm

echo ~ftp
should display the full path of the ftp account's home directory.

Or if you want more info,
grep <username> /etc/passwd
will show you the raw entry from the system's user list for any user, which contains the numerical user ID, default group ID, full name, home directory path, and default shell. (The name of the file is historical; back in the day, it also used to contain the users' encrypted passwords. Modern *NIX systems no longer do this, since the amount of computing power available on modern systems has made brute force password cracking too easy.)
The years just pass like trains. I wave, but they don't slow down.
-- Steven Wilson
 
flip-mode
Gerbil Khan
Topic Author
Posts: 9322
Joined: Thu May 08, 2003 12:42 pm
Location: Cincinnati, OH

Re: Linux - display all user info

Mon Feb 28, 2011 8:32 pm

Sweet, JBI. Thanks.
 
bigfootape
Gerbil
Posts: 12
Joined: Wed Jun 18, 2003 12:43 pm

Re: Linux - display all user info

Wed Mar 02, 2011 8:05 pm

egrep ^username /etc/passwd


Otherwise, you're getting all matches in the password file, regardless of position. Useful for people with names like Ed.
A novice asked the master: "What is the true meaning of programming?"
The master replied: "Eat when you are hungry, sleep when you are fatigued, program when the moment is right."
-- The Tao of Programming
 
just brew it!
Gold subscriber
Administrator
Posts: 44200
Joined: Tue Aug 20, 2002 10:51 pm
Location: Somewhere, having a beer

Re: Linux - display all user info

Wed Mar 02, 2011 8:24 pm

bigfootape wrote:
egrep ^username /etc/passwd

Otherwise, you're getting all matches in the password file, regardless of position. Useful for people with names like Ed.

Yup. But as long as you're just eyeballing the output (not feeding it to another script to do something automated), it doesn't really matter.

In any case, if we're being pedantic, it should be:
egrep ^username: /etc/passwd

That way you won't get Edith when you were really looking for Ed. :wink:
The years just pass like trains. I wave, but they don't slow down.
-- Steven Wilson

Who is online

Users browsing this forum: No registered users and 2 guests