#== Create the script to change password.
$vi chpwd.sh
#!/bin/shecho "root:newpasswd" | /usr/sbin/chpasswd
$chmod +rx chpwd.sh
#==Copy the script the remote-host and execute it
sudo is used because root ssh login is disabled, for unknown reason the temp file couldn't be deleted with sudo, so it is emptied instead
$scp -p chpwd.sh remote-host:/tmp/chpwd.sh
$ssh remote-host sudo '/tmp/chpwd.sh;cat /dev/null>/tmp/chpwd.sh;cat /tmp/chpwd.sh'
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.