- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Linux how to manage passwords -automatically chang...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2014 05:02 AM
03-10-2014 05:02 AM
Linux how to manage passwords -automatically change password on linux servers
How to easily manage your passwords on the Linux server?
I wonder how or what tool it was good to change password on linux servers, a time to change the password on 100 servers.
- Tags:
- Password
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2014 05:43 AM
03-10-2014 05:43 AM
Re: Linux how to manage passwords -automatically change password on linux servers
Most Linux distributions include a "chpasswd" tool, which is useful when changing a large number of passwords at once.
First, you create a file which contains one line for each user whose password you wish to change, like this:
user1:password1 user2:password2
etc.
The passwords can be either clear-text or encrypted (hashed): if you encrypt the password, you must use the -e option with the chpasswd command.
Then, you pipe this file to the chpasswd command.
If you have set up SSH keys or some other method that allows you to run commands on remote hosts as root without typing the password each time, you could automate this with a small shell script, like this:
#!/bin/sh MACHINELIST=machines.txt PASSWORDFILE=passwords.txt exec < $MACHINELIST while read MACHINE do ssh root@$MACHINE chpasswd < $PASSWORDFILE RESULT=$? if [ $RESULT -ne 0 ] then echo "Error $RESULT reported with machine $MACHINE, continuing..." >&2 fi done
The above scripts needs a list of machines as "machines.txt" and the passwords file for the chpasswd command as "passwords.txt".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2014 04:38 AM
03-14-2014 04:38 AM
Re: Linux how to manage passwords -automatically change password on linux servers
Hello,
Matti gave you a simple and good advice.
On Linux, there are other nice ways to change password to "newpass"
for user "username".
For example:
# echo newpass | passwd --stdin username
If you want to automate the whole process, maybe you get some ideas from my Perl script
for adding batch users accross five operating systems:
http://www.circlingcycle.com.au/Unix-sources/add-batch-Unix-accounts.pl.txt
... and while we are at it, if you want pseudo-random passwords,
here are some ideas:
# < /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c8 # date '+.%N' | md5sum | cut -c1-8 # openssl rand -base64 32 | head -c8 # makepasswd # shuf -n1 /usr/share/dict/words Linux has almost unlimited possibilities