mirror of https://github.com/jumpserver/jumpserver
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
330 B
21 lines
330 B
10 years ago
|
#!/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"
|
||
|
|
||
|
ssh -p $host2_port $host2 "echo \"$password\" | passwd --stdin \"$username\""
|