Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 04-22-2006, 02:23 PM   #1
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.

Old 04-22-2006, 02:38 PM   #2
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?

Old 04-22-2006, 03:20 PM   #3
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

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
Senior Member
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,138

Rep: Reputation: 168Reputation: 168
Do you have the chpasswd utility on your system? From man chpasswd:
       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


       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.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 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 > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:29 PM.

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