Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SSH

Status
Not open for further replies.

kumsaga

MIS
Jun 21, 2002
22
US
Hi ,
we have 100 servers and we have password expiration set on all of them , I have my SSH keys setup so that I can log in to any of the server with out giving password. Is there any good way of changing my password with out logging on to all the machines.
Thank you .
Sagar
 
expect.


Here's a little sample to get you started.

Code:
send -- "passwd\r"
expect {
  -re "assword" {
  send -- "yournewpassword\r"
}

If you try some other language, one thing that is a gotcha for everyone is when you use the passwd command and it displays the New password: prompt, it is displayed to STDERR *not* STDOUT.


--
Andy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top