LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux > Linux - General > LinuxAnswers Discussion
User Name
Password
LinuxAnswers Discussion This forum is to discuss articles posted to LinuxAnswers.

Notices

Reply
 
Thread Tools
Old 10-23-2005, 10:30 PM   #1
amitsharma_26
Member
 
Registered: Sep 2005
Location: New delhi
Distribution: RHEL 3.0/4.0
Posts: 777
Thanked: 0
Post DISCUSSION: How to list all your USERs..


[Log in to get rid of this advertisement]
This thread is to discuss the article titled: How to list all your USERs..
amitsharma_26 is offline     Reply With Quote
Old 03-28-2006, 07:58 PM   #2
linuxlinux
LQ Newbie
 
Registered: Mar 2006
Location: Adelaide
Distribution: FreeBSD, Fedora C4, windows Server 2003
Posts: 15
Thanked: 0
Well when I tried to execute this command this is the answer any idea why has this turned up

[root@unisa ~]# cat /etc/passwd |grep /bin/bash |grep [5-9][0-9][0-9] |cut -d: -f1
Harry
harry
steve
master
help
[root@unisa ~]# alias listuser=cat /etc/passwd |grep /bin/bash |grep [5-9][0-9][0-9] |cut -d: -f1
-bash: alias: /etc/passwd: not found
[root@unisa ~]#
linuxlinux is offline     Reply With Quote
Old 03-28-2006, 08:43 PM   #3
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware 12.1, Slackware 13.0
Posts: 3,788
Thanked: 20
You need to wrap it in quotes the way they do in the article:
Code:
alias userlist='cat /etc/passwd |grep "/bin/bash" |grep "[5-9][0-9][0-9]" |cut -d: -f1'
gilead is offline     Reply With Quote
Old 11-06-2006, 02:09 AM   #4
sysconfig
Member
 
Registered: Sep 2006
Location: (.)
Posts: 44
Thanked: 0
awk -F":" '{ print "username: " $1 "\t\tuid:" $3 }' /etc/passwd
sysconfig is offline     Reply With Quote
Old 01-11-2008, 01:38 PM   #5
hardened
LQ Newbie
 
Registered: Jan 2008
Posts: 1
Thanked: 0
Thumbs up great alternate method

Quote:
Originally Posted by sysconfig View Post
awk -F":" '{ print "username: " $1 "\t\tuid:" $3 }' /etc/passwd
Wow! Awesome alternate method. Thx Sysconfig!
awk and gawk are really powerful, I need to spend some time studying them.
hardened is offline     Reply With Quote
Old 06-30-2008, 10:16 AM   #6
eponcedeleonc
LQ Newbie
 
Registered: Jun 2008
Posts: 4
Thanked: 0
how do you list users and passwords? I need to do that.
Thank you
eponcedeleonc is offline     Reply With Quote
Old 06-30-2008, 04:30 PM   #7
salasi
Senior Member
 
Registered: Jul 2007
Location: Directly above centre of the earth, UK
Distribution: SuSE, plus some hopping
Posts: 1,878
Thanked: 88
Quote:
Originally Posted by eponcedeleonc View Post
how do you list users and passwords?
Hmm, so you want a potential security hole that allows any hacker who can get the root password (or even get briefly to a terminal in use by a root user) to get every login password on the system? Are you really sure that's a good idea?

PS: I wouldn't tell you even if I knew. Which I don't.
salasi is offline     Reply With Quote
Old 07-01-2008, 03:06 AM   #8
win32sux
Moderator
 
Registered: Jul 2003
Distribution: Ubuntu 8.10
Posts: 8,603
Thanked: 106
Quote:
Originally Posted by eponcedeleonc View Post
how do you list users and passwords? I need to do that.
Being able to list users' passwords would imply that the passwords are stored somewhere on the system, which is not the case. What is stored are salted hashes of the passwords. So unless you've changed something to the standard way GNU/Linux handles user passwords, you won't be able to get any password list.

Last edited by win32sux; 07-01-2008 at 03:07 AM..
win32sux is offline     Reply With Quote
Old 07-01-2008, 01:07 PM   #9
eponcedeleonc
LQ Newbie
 
Registered: Jun 2008
Posts: 4
Thanked: 0
well I have a user from another company that has access to the server and DB as root and due to company problems with their company we are going manage the server and DB and i need to know how to block him from having any access to the server and DB.. its just a precaution that needs to be considered, and i dunno if changing the root password would be enough!
eponcedeleonc is offline     Reply With Quote
Old 07-01-2008, 07:25 PM   #10
win32sux
Moderator
 
Registered: Jul 2003
Distribution: Ubuntu 8.10
Posts: 8,603
Thanked: 106
Quote:
Originally Posted by eponcedeleonc View Post
well I have a user from another company that has access to the server and DB as root and due to company problems with their company we are going manage the server and DB and i need to know how to block him from having any access to the server and DB.. its just a precaution that needs to be considered, and i dunno if changing the root password would be enough!
Changing the root password might be enough if you had a way to be sure that he didn't install any sort of backdoor. And you don't have any way to be sure of that unless you did something like take a HIDS snapshot or something before you gave him root access. That said, I'm still not sure how this relates to getting a listing of users' passwords. I mean, you don't need to know that passwords in order to change them. And the guy with root could have easily installed a password sniffer to get everyone's passwords if he wanted them (since cracking the salted hashes would probably be infeasible for him).
win32sux is offline     Reply With Quote

Reply

Bookmarks


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
What is the command to list users? neo_in_matrix Linux - Newbie 14 11-04-2009 03:02 AM
How to list existing users? stefaandk Linux - Newbie 11 04-03-2006 02:03 AM
How do I list all users (even those not logged in) steved Linux - Newbie 2 09-29-2005 05:45 PM
list out the users. bruse Linux - Newbie 2 07-19-2005 09:46 AM
List all users eam Linux - Newbie 7 05-16-2005 12:55 AM


All times are GMT -5. The time now is 06:44 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
RSS2  LQ Podcast
RSS2  LQ Radio
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration