DISCUSSION: How to list all your USERs..
This thread is to discuss the article titled: How to list all your USERs..
|
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 ~]# |
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' |
awk -F":" '{ print "username: " $1 "\t\tuid:" $3 }' /etc/passwd
|
great alternate method
Quote:
awk and gawk are really powerful, I need to spend some time studying them. |
how do you list users and passwords? I need to do that.
Thank you |
Quote:
PS: I wouldn't tell you even if I knew. Which I don't. |
Quote:
|
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!
|
Quote:
|
Quote:
Did my own variation: awk -F":" '{ print "Linux_name: " $1 "\t\tFull_Name: " $5 }' /etc/passwd |
Quote:
The security permissions are exactly designed around limiting access to only that which is required to perform the task at hand. If the other company requires unlimited database access that is alowable through your specific DB admin tool or command? Regards |
How to list all your user
cat /etc/passwd (to display all user )
cat /etc/passwd | wc -l (to count how many user is there ur system ) |
All times are GMT -5. The time now is 10:51 PM. |