Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Extracting User Data to CSV file

Status
Not open for further replies.

Bigpants

IS-IT--Management
May 12, 2005
9
US
Hi all hope you can help me out, here is my dilema. I am migrating to a new linux mail server (@mail) from sendmail. The new server is on a completely different box.
I can import all the user information into @mail but it has to be imported from a CSV file.

Is there anyway that I can do this? Export all the user information into a CSV file eg, username, password, domain name etc? If so how is it done. I am pretty much a linux newbie and still tying to find my way around this OS

Cheers and thanks in Advance
Colin
 
Username & passwords can be extracted from /etc/shadow by using this command:
grep -v [\!\!,*] /etc/shadow | cut --delimiter=":" -f 1,2 | sed s/:/,/g > users.csv


--== Anything can go wrong. It's just a matter of how far wrong it will go till people think its right. ==--
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top