jumpserver/chgpass.sh

21 lines
331 B
Bash
Raw Normal View History

2014-08-14 09:22:25 +00:00
#!/bin/bash
username=$1
password=$2
cwd (){
dir=$0
dirname $dir
}
dir=$(cwd)
. ${dir}/shell.conf
id ${username} &> /dev/null
if [ $? != 0 ];then
echo "$username is not exist."
exit 3
fi
echo "$password" | passwd --stdin "$username"
2014-08-15 07:43:39 +00:00
#ssh -p $host2_port $host2 "echo \"$password\" | passwd --stdin \"$username\""