-
listing users on a server
Hi, I was wondering if there was any way to list the users with an account on a server? I have an account on a UNIX server at my college, and I was wondering if I could get a list of account names on the command line so that I don't have to ask a bunch of teachers what their user name is to send them messages or anything. Thanks a lot
-
'finger' is a great app for that, if it's installed.
/etc/passwd will also have the users
-
when i try the /etc/passwd it tells me permission denied. im only a local user, i dont have access to root. im still new to the unix environment, so i dont know lots about the command line. any other suggestions?
-
Most of the users have home directories, they're usually in /home. You may want to try to list its contents.
djserz.com.ar
"All the drugs in this world won't save you from yourself..."
-
As most of the users home directory are placed in the /home, you can simply count the directories to get a number, provided you have read permission on the /home.
Fire in
Code:
ls -l /home | wc -l
it will give you a number close to the actual user count.
-
Try using
to output the password file. All users usually have read access to this file so the above command should work.
Or you could use finger.
Hope this helps.
- Suramya
--------------------------------------------------
My Website: http://www.suramya.com
My Blog: http://www.suramya.com/blog
Registered Linux User #: 309391
--------------------------------------------------
*************************************************
Disclaimer:
Any errors in spelling, tact, or fact are transmission errors.
*************************************************
-
Or, if you want just the usernames (not the home directories, shells, extended info, etc.), you can do it with cut:
cut -d: -f1 /etc/passwd
The -d: argument tells cut to use the : character as its delimiter, and the -f1 argument tells cut to print only the first field. (Fields are delimited by the delimiter, just in case that's not obvious from the name. )
Also note that not everything in /etc/passwd is necessarily a human user, either. A lot of daemons use a special restricted user to run as -- openssh, Apache, and BIND can all be configured to do that. So you might have to do some manual or semi-manual filtering on this list, but it should get you close.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|