change password for multiple host


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting change password for multiple host
# 1  
Old 11-06-2009
change password for multiple host

1-How can i change root password of 5 Fedora 11 machines (server1 server2 server3 server4 server5) with a single script ,
for example make password : 123456

NB. from server1 i can via ssh connect to the others machines without a password

Please help.
# 2  
Old 11-06-2009
Maybe this can help:

Code:
man chpasswd

i.e.

Code:
for SERVER in server1 server2 etc; do
  ssh $SERVER 'echo "root:123456" | chpasswd'
done

chpasswd is available on RHEL and CentOS, so I imagine on Fedora too.

Last edited by Scott; 11-06-2009 at 07:25 AM.. Reason: removed -n option from ssh
# 3  
Old 11-06-2009
Quote:
Originally Posted by scottn
Maybe this can help:

Code:
man chpasswd

i.e.

Code:
for SERVER in server1 server2 etc; do
  ssh $SERVER 'echo "root:123456" | chpasswd'
done

chpasswd is available on RHEL and CentOS, so I imagine on Fedora too.
is there any other way that server1 will copy /etc/password and shadow file to other server via scp , without to apply the password on every machine ?
# 4  
Old 11-06-2009
Are you sure that's such a good idea?

You want to change the root password on a handful of servers. Is that so complicated?

Reading your original post again, I may have mis-interpreted this at the time:

Quote:
NB. from server1 i can via ssh connect to the others machines without a password
The root password has absolutely nothing to do with connecting to other machines via ssh.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Forum Support Area for Unregistered Users & Account Problems

Password sent via reset password email is 'weak' and won't allow me to change my password

I was unable to login and so used the "Forgotten Password' process. I was sent a NEWLY-PROVIDED password and a link through which my password could be changed. The NEWLY-PROVIDED password allowed me to login. Following the provided link I attempted to update my password to one of my own... (1 Reply)
Discussion started by: Rich Marton
1 Replies

2. Shell Programming and Scripting

Shell script to change the password on multiple servers in linux

Can any one please let me know the shell script to change the password for a particular user on multiple linux servers. (2 Replies)
Discussion started by: s_madras
2 Replies

3. UNIX for Dummies Questions & Answers

Need to reset password on remote host

I have access to a variety of hosts. I need to be able to reset my password on 400+ hosts every 80 days due to password expiration. I connect to these servers across the country using an ssh telnet terminal. I am a Security Administrator, but I don't manage the Unix machines on our network. Is... (1 Reply)
Discussion started by: XtremeRevolutio
1 Replies

4. Solaris

Can't change fully qualified host name

I tried changing my /etc/inet/hosts file for my server to: <ip address> <hostname> <fqdn> but when I go to reboot the file changes right back to: <ip address> <hostname> how do I get the <fqdn> to stick on a reboot. Thanks (2 Replies)
Discussion started by: jastanle84
2 Replies

5. Shell Programming and Scripting

rsh login to host with password

Hello, iḿ rather new to writing scripts in UNIX so i thought this would be a good start. I need to write a script that can login to different hosts in a standalone network. That means there are no connection to Internet etc. I need to collect some data on the hosts, and they have different... (11 Replies)
Discussion started by: topy
11 Replies

6. Shell Programming and Scripting

Change $HOST in /etc/hosts

I want to change the following lines in /etc/hosts on FreeBSD: ::1 localhost localhost.my.domain 127.0.0.1 localhost localhost.my.domain into the following lines ::1 localhost foo.example.com 127.0.0.1 localhost foo.example.com I have the following script to do... (5 Replies)
Discussion started by: figaro
5 Replies

7. Shell Programming and Scripting

how to change root password using shell script with standard password

Hi Friends. I am new to scripting now i want to change the root password using the script with standard password. which is the easy scripting to learn for the beginner, Thanks in advance. (2 Replies)
Discussion started by: kurva
2 Replies

8. AIX

NIM host name change

Hi I have a NIM server on AIX 5.3.08.02. I had to change the host name and I now have nimsh connection issues to the NIM clients. All host files and DNS entries are correct with the new host name. I have tried editing the niminfo files on the NIM server and NIM clinet. I have tried removing the... (2 Replies)
Discussion started by: kimyo
2 Replies

9. UNIX and Linux Applications

set mysql password with host parameter

hi, linux gurus... i'm trying to write a script in ksh called ResetPass that allows a user to change mysql passwords. the script accepts user, password and host like this: ResetPass <user> <password> <host>. here's the code: ***************************************************** mysql... (1 Reply)
Discussion started by: ankimo
1 Replies

10. UNIX for Dummies Questions & Answers

Change password by pushing encrypted password to systems

I'm tasked to change a user's password on multiple Linux systems (RH v3). I though copying the encrypted password from one Linux /etc/shadow file to another would work but I was wrong. The long term solution is to establish an openLDAP Directory service, but for now I'm stuck with a manual... (1 Reply)
Discussion started by: benq70
1 Replies
Login or Register to Ask a Question