LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 05-29-2012, 05:10 PM   #1
tedcreyn
LQ Newbie
 
Registered: May 2012
Posts: 6

Rep: Reputation: Disabled
I need a program to sync passwords on all our linux boxes on network


Is there such a program? All I need for it to do is make sure that when a user has changed their password on one box it propagates to all others. I do not need it to provide authentication on the network. I also don't mean a password manager that just helps folks remember their passwords. I just need it to sync the passwords.
 
Old 05-29-2012, 05:43 PM   #2
Kustom42
Senior Member
 
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,604

Rep: Reputation: 415Reputation: 415Reputation: 415Reputation: 415Reputation: 415
This is one feature that Windows has over Linux for ease of use. Look at standing up a single windows box as a domain controller, then setup ldap or winbind to query against the domain controller for the password. That way no passwords are stored locally and any updates are realized immediately by your systems on the network. Besides that the only thing I could think of would be a cron job or something similar to do a copy of the /etc/shadow file.
 
Old 05-29-2012, 07:34 PM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Actually, Linux provides OpenLDAP; no need for MSWin box.
Try http://www.linuxhomenetworking.com/w...DAP_and_RADIUS (ignore refs to RADIUS) & Chap 24 of http://www.linuxtopia.org/online_boo...ion/index.html
 
Old 05-29-2012, 08:43 PM   #4
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,324
Blog Entries: 28

Rep: Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142
Another alternative to look at might be Cluster SSH. I've never had occasion to use it, but I've heard it highly recommended by a Linux sysadmin.
 
Old 05-30-2012, 11:37 AM   #5
tedcreyn
LQ Newbie
 
Registered: May 2012
Posts: 6

Original Poster
Rep: Reputation: Disabled
Thanks folks, but setting up LDAP seems a bit of an overkill. We don't wan't single sign on, we just need to make sure that the users passwords are propagated to all other ubuntu boxes when it is changed on one of them. Is there anything other than LDAP for such a requirement?
 
Old 05-30-2012, 06:16 PM   #6
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
In the end, synchronizing clients is much more complicated than centralized login. I find NIS simpler than LDAP, but I am lazy, and I should have looked into LDAP.

Think about something similar: users have a home directory where they store their files. What would be easier, to create a central shared disk, of keep all the home directories on the clients in sync in one or another way?

jlinkels
 
Old 05-30-2012, 06:51 PM   #7
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
NIS is certainly simpler, but its plaintext only, OpenLDAP has the TLS option
I believe that even in Solaris (SUN wrote NIS), people are moving away from NIS.

The classic soln used to be NIS for auth and NFS for home disks as jlinkels hinted.

Last edited by chrism01; 05-30-2012 at 06:53 PM.
 
Old 05-31-2012, 03:07 AM   #8
Refractor
Member
 
Registered: Oct 2008
Location: Rousse, Bulgaria
Distribution: Debian
Posts: 91

Rep: Reputation: 25
One can change password with
Code:
echo -e "OLDPASSWORD\nNEWPASSWORD\nNEWPASSWORD | passwd"
If it's the root user just cut out the OLDPASSWORD\n part.
Knowing this, one can write a wrapper script like
Code:
#!/bin/bash

HOSTS=('10.0.0.1' '10.0.0.2' '10.0.0.3')

if [[ $(whoami) != "root" ]]; then
read -p "Old password: " -s OLDPASSWD; echo
read -p "New password: " -s NEWPASSW1; echo
read -p "Retype password: " -s NEWPASSW2; echo
NONROOT=1
else
read -p "Username: " -s CHPWUSER; echo
read -p "New password: " -s NEWPASSW1; echo
read -p "Retype password: " -s NEWPASSW2; echo
fi

echo "Updating local password: "

if [[ "$NONROOT" == 1 ]]; then echo -e "$OLDPASSWD\n$NEWPASSW1\n$NEWPASSW2" | passwd;
else echo -e "$NEWPASSW1\n$NEWPASSW2" | passwd $CHPWUSER;
fi

echo "Updating remote hosts: "
if [[ "$NONROOT" == 1 ]]; then
for host in ${HOSTS[@]}; do
echo "Changing password on $host";
#ssh $host 'echo -e "$OLDPASSWD\n$NEWPASSW1\n$NEWPASSW2" | passwd';
done
else
for host in ${HOSTS[@]}; do
echo "Changing password on $host";
#ssh root@$host 'echo -e "$NEWPASSW1\n$NEWPASSW2" | passwd $CHPWUSER';
done
fi
Hope this helps.

Last edited by Refractor; 05-31-2012 at 09:58 AM. Reason: fixing a bug in the bash code
 
1 members found this post helpful.
Old 02-14-2020, 07:09 AM   #9
/jarv
LQ Newbie
 
Registered: Feb 2020
Posts: 2

Rep: Reputation: Disabled
Thumbs down

This script doesn't work since the env variables will not be present in the session running on the the remote host during the ssh - try it out and you'll see.
 
Old 02-14-2020, 09:51 AM   #10
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,848

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
But:
Code:
 echo string | ssh host passwd
may work
 
1 members found this post helpful.
Old 02-14-2020, 11:07 AM   #11
/jarv
LQ Newbie
 
Registered: Feb 2020
Posts: 2

Rep: Reputation: Disabled
Yes indeed the adjustment works.

I added the -q to suppress motd

echo -e "$OLDPASSWD\n$NEWPASSW1\n$NEWPASSW2" | ssh -q $host passwd

works a treat
 
  


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 Multiple Linux Servers Users, groups and passwords waddy Linux - Server 6 02-29-2008 06:28 AM
Sync Samba and Linux passwords gtjmn308 Linux - Software 1 04-04-2006 10:22 PM
Sharing passwords over multiple boxes king_dan Linux - Networking 1 01-04-2006 07:32 PM
Sync MySQL passwords with local account passwords? turbine216 Linux - Software 2 02-18-2005 03:15 AM
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 - Software

All times are GMT -5. The time now is 03:10 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