A script to change password for all other servers

If that is just a comment not requiring follow-up, fine.

If not, open a new thread, giving exact and complete infos on WHAT and HOW doesn't work, using code tags where appropriate and required by forum rules.

1 Like

Can someone please explain to me what are "code tags"? How to use them? And why are they required?

Many thanks in advance.

Code tags temporarily suspend html formatting so spacing, indenting etc. are preserved and monospace fonts are used. They work like code or data text ; you can enter them manually or highlight the text and press the button in the editor toolbar. For strings or small partial text lines, use tags.

1 Like

This is just a test for me to see what's the difference between using code tags and not. Please ignore; thanks.

scp -r tstnglbz1:/export/home/mchavoshi/bin .

scp -r tstnglbz1:/export/home/mchavoshi/bin .

The Solaris passwd command wants a terminal.
I don't like expect.
But here is how I changed the root password

#!/bin/sh
filename="$1"
if [ -z "$filename" ]; then
  echo "usage: $0 hostfile"
  exit 1
fi
while read host <&3
do
  ssh -t "root@$host" "passwd"
done 3< "$filename"

For every host it prompts for an interactive password, two times,
but if you can use copy/paste then it's a matter of paste-enter-paste-enter,...