LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-18-2008, 02:26 PM   #1
zeynep
Member
 
Registered: Jan 2008
Posts: 34
Blog Entries: 1

Rep: Reputation: 15
lists of users


hello,
how can i list the users and their own groups seperately at the system

i see as making;

cat /etc/passwd

but i want to see list of groups and their users at the system
 
Old 01-18-2008, 02:41 PM   #2
bsdunix
Senior Member
 
Registered: May 2006
Distribution: BeOS, BSD, Caldera, CTOS, Debian, LFS, Mac, Mandrake, Red Hat, Slackware, Solaris, SuSE
Posts: 1,761

Rep: Reputation: 80
Maybe something like:
Code:
# for i in `cat /etc/passwd | cut -d: -f1` ; do id $i ; done
 
Old 01-18-2008, 03:02 PM   #3
zeynep
Member
 
Registered: Jan 2008
Posts: 34

Original Poster
Blog Entries: 1

Rep: Reputation: 15
Thank you for your answer

How can i see the passworless of them and keep in an folder is ther any special command or this kind of thing
 
Old 01-18-2008, 03:07 PM   #4
bsdunix
Senior Member
 
Registered: May 2006
Distribution: BeOS, BSD, Caldera, CTOS, Debian, LFS, Mac, Mandrake, Red Hat, Slackware, Solaris, SuSE
Posts: 1,761

Rep: Reputation: 80
Code:
# for i in `cat /etc/passwd | cut -d: -f1` ; do id $i ; done > /path/to/my/file
Everytime you run this, the contents of /path/to/my/file will be updated. You can view/edit the file with whatever editor/viewer of your choice.
 
Old 01-18-2008, 03:15 PM   #5
zeynep
Member
 
Registered: Jan 2008
Posts: 34

Original Poster
Blog Entries: 1

Rep: Reputation: 15
hımmmm ok. thank you
but i wanna list to the passwordless of them and list the for example in a passworless file.

First i have created a file passwordless

then i used '>' but i couldnt see i think first i should list passwordless of them then send to file passwordless but every user have a password
 
Old 01-18-2008, 03:31 PM   #6
zeynep
Member
 
Registered: Jan 2008
Posts: 34

Original Poster
Blog Entries: 1

Rep: Reputation: 15
in the list i see some of them havent password can i send to passwordless folder?how i can
 
Old 01-18-2008, 04:04 PM   #7
bsdunix
Senior Member
 
Registered: May 2006
Distribution: BeOS, BSD, Caldera, CTOS, Debian, LFS, Mac, Mandrake, Red Hat, Slackware, Solaris, SuSE
Posts: 1,761

Rep: Reputation: 80
On a modern Linux system there should not be any passwords in the /etc/passwd file.

You might be looking at the /etc/shadow file which lists the encrypted/hashed password for the user.

Linux Password & Shadow File Formats
http://tldp.org/LDP/lame/LAME/linux-...e-formats.html

Last edited by bsdunix; 01-18-2008 at 05:17 PM.
 
Old 01-18-2008, 04:42 PM   #8
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
How about an awk version?

Code:
awk -F: '{print $1:$5}' /etc/passwd > /path/to/my/file

Cheers,
Tink
 
Old 01-19-2008, 04:21 AM   #9
zeynep
Member
 
Registered: Jan 2008
Posts: 34

Original Poster
Blog Entries: 1

Rep: Reputation: 15
hello,
i tried to use awk when i wrote

awk -F : '{ print $1:$5 }' I'm getting error

i couldnt solve yet any idea?
 
Old 01-19-2008, 12:22 PM   #10
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Maybe if you told us the error... ?
You could try to just copy & paste rather than typing. And what version
of awk has your distro got installed, what distro are you on?


Cheers,
Tink
 
Old 01-19-2008, 12:34 PM   #11
zeynep
Member
 
Registered: Jan 2008
Posts: 34

Original Poster
Blog Entries: 1

Rep: Reputation: 15
hi thank you for interest

awk -F: '{print $1:$5}' /etc/passwd > passwdless

awk:{print $1:$5}
awk: ^syntax error
 
Old 01-19-2008, 12:49 PM   #12
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Ooops ... my bad. I forgot to put quotes around the colon
which I wanted to be the separator.

Code:
awk -F: '{print $1":"$5}' /etc/passwd
I'm curious still which version of Linux you're using, because
I haven't seen a password-hash stored in /etc/passwd in a very
long time.



Cheers,
Tink
 
Old 01-19-2008, 01:09 PM   #13
zeynep
Member
 
Registered: Jan 2008
Posts: 34

Original Poster
Blog Entries: 1

Rep: Reputation: 15
hi
thank you now its work but output like that
operatorperator
games:games
gopher:gopher
ftpusoperatorperator
tcpdump:
snmsp:
apache:Apache
mysql:Mysql service

but i would like to see passwordless of them how can it?

im using fedora
 
Old 01-19-2008, 01:46 PM   #14
XavierP
Moderator
 
Registered: Nov 2002
Location: Kent, England
Distribution: Debian Testing
Posts: 19,192
Blog Entries: 4

Rep: Reputation: 475Reputation: 475Reputation: 475Reputation: 475Reputation: 475
The passwords are stored in an encrypted fashion and cannot be read. If they are not your own passwords you should not have them.
 
Old 01-19-2008, 06:18 PM   #15
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Quote:
Originally Posted by zeynep View Post
hi
thank you now its work but output like that
operatorperator
games:games
gopher:gopher
ftpusoperatorperator
tcpdump:
snmsp:
apache:Apache
mysql:Mysql service

but i would like to see passwordless of them how can it?

im using fedora
Well ... you asked for the users and their groups. I still don't
understand what you mean by "see passwordless" in this context.



Cheers,
Tink
 
  


Reply



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
Sendmail: How to make only users in hosts can send to mailing lists? batbayar Linux - Server 3 05-08-2007 01:22 AM
I need lists deathbyswiftwin Linux - General 4 04-21-2006 07:10 PM
Winbind lists AD users, but doesn't map them Thakowbbery Linux - Networking 1 08-02-2005 01:09 PM
a vector containing lists Kroenecker Programming 3 07-23-2005 01:03 AM
Mailing Lists Orwick Alefgard Linux - General 3 08-22-2003 01:25 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:00 AM.

Main Menu
Advertisement
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
Twitter: @linuxquestions
Open Source Consulting | Domain Registration