LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-22-2006, 02:23 PM   #1
nickyboy
LQ Newbie
 
Registered: Mar 2006
Posts: 2

Rep: Reputation: 0
Reset all Passwords


I have a list of users and I'd like to reset all the passwords to the same - can do them all at once, if so how ?

(Samba passwords too) I'm using Redhat 3.

Thx
 
Old 04-22-2006, 02:38 PM   #2
anti.corp
Member
 
Registered: Nov 2005
Location: Copenhagen
Distribution: Debian E, Vectorlinux 5.1std, Arch, Gentoo 2006.0
Posts: 576

Rep: Reputation: 30
I dont think you can change them all in one command.

You could set them to 'null' using this command:
usermod -p "" username

How many users do you have?

regards,
 
Old 04-22-2006, 03:20 PM   #3
pen8wen
LQ Newbie
 
Registered: Apr 2006
Posts: 17

Rep: Reputation: 0
assuming the list of users is in userlist (and that they are the same names as you want reset for smb) and that by reset, you mean to have no passwd reqmt during login, ie, no passwd reqd)

for user in `cat userlist` ; do
usermod -p "" $user
smbpasswd -n $user
done

note that the single quotes in the "for" clause is a single back quote, not the apostrophe to the right of the ";"

why would you want to do this? did you mean to remove the ability to login for users on the list? in that case, use passwd -l instead of usermod.

see man passwd, man smbpasswd, man usermod

Last edited by pen8wen; 04-22-2006 at 03:21 PM.
 
Old 04-22-2006, 03:22 PM   #4
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
Do you have the chpasswd utility on your system? From man chpasswd:
Code:
       chpasswd reads a file of user name and password pairs from standard input and uses this information to
       update a group of existing users. Without the -e switch, the passwords are expected to  be  cleartext.
       With the -e switch, the passwords are expected to be in encrypted form.  Each line is of the format

              user_name:password

       The named user must exist.  The supplied password will be encrypted as necessary, and the password age
       updated, if present
That doesn't help with Samba though... You can use apropos passwd to get a list of password related man pages.
 
  


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
Sync MySQL passwords with local account passwords? turbine216 Linux - Software 2 02-18-2005 03:15 AM
Completely uninstalling MySQL and its passwords passwords...how? I locked myself out! Baix Linux - Newbie 2 01-30-2005 04:10 PM
Passwords fatcpu Mandriva 2 11-20-2003 02:22 PM
Passwords fatcpu Mandriva 2 11-03-2003 12:14 PM
Is there a way to sync Samba passwords with linux user passwords MarleyGPN Linux - Networking 2 09-09-2003 10:59 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:59 PM.

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