mirror of https://github.com/jumpserver/jumpserver
去掉备份冗余
parent
8feb77416d
commit
a19a8e86df
|
@ -18,4 +18,4 @@ fi
|
|||
|
||||
echo "$password" | passwd --stdin "$username"
|
||||
|
||||
ssh -p $host2_port $host2 "echo \"$password\" | passwd --stdin \"$username\""
|
||||
#ssh -p $host2_port $host2 "echo \"$password\" | passwd --stdin \"$username\""
|
|
@ -25,13 +25,13 @@ fi
|
|||
gen_key ${password}
|
||||
|
||||
mkdir -p /home/${user}/.ssh
|
||||
ssh -p ${host2_port} ${host2} "mkdir -p /home/$user/.ssh"
|
||||
#ssh -p ${host2_port} ${host2} "mkdir -p /home/$user/.ssh"
|
||||
|
||||
cat ${keyfile}.pub > /home/${user}/.ssh/authorized_keys
|
||||
ssh -p ${host2_port} ${host2} "cat > /home/$user/.ssh/authorized_keys" < ${keyfile}.pub
|
||||
#ssh -p ${host2_port} ${host2} "cat > /home/$user/.ssh/authorized_keys" < ${keyfile}.pub
|
||||
|
||||
chmod 600 /home/${user}/.ssh/authorized_keys
|
||||
ssh -p ${host2_port} ${host2} "chmod 600 /home/$user/.ssh/authorized_keys"
|
||||
#ssh -p ${host2_port} ${host2} "chmod 600 /home/$user/.ssh/authorized_keys"
|
||||
|
||||
chown -R ${user}:${user} /home/${user}/.ssh
|
||||
ssh -p ${host2_port} ${host2} "chown -R $user:$user /home/$user/.ssh"
|
||||
#ssh -p ${host2_port} ${host2} "chown -R $user:$user /home/$user/.ssh"
|
|
@ -1,10 +1,10 @@
|
|||
#!/bin/bash
|
||||
|
||||
if [ $USER = 'yolu' ] || [ $USER == 'root' ];then
|
||||
if [ $USER = 'admin' ] || [ $USER == 'root' ];then
|
||||
echo ""
|
||||
else
|
||||
python /opt/jumpserver/jumpserver.pyo
|
||||
if [ $USER == 'guanghongwei' ] || [ $USER == 'liufuhua' ];then
|
||||
if [ $USER == 'guanghongwei' ];then
|
||||
echo
|
||||
else
|
||||
exit 3
|
||||
|
|
|
@ -2,5 +2,5 @@
|
|||
|
||||
host=127.0.0.1
|
||||
ldapassword=VNLqNCjpNBIetEoCA2h3
|
||||
host2=172.16.2.74
|
||||
host2_port=2001
|
||||
#host2=172.16.2.74
|
||||
#host2_port=2001
|
|
@ -14,6 +14,5 @@ if [ $? == '0' ];then
|
|||
userdel -r $username
|
||||
else
|
||||
echo "$username is not exist."
|
||||
exit 3
|
||||
fi
|
||||
ldapdelete -x -h $host -D "cn=admin,dc=yolu,dc=com" -w $ldapassword "cn=$username,ou=Sudoers,dc=yolu,dc=com"
|
|
@ -20,7 +20,7 @@ fi
|
|||
id $username &> /dev/null
|
||||
if [ $? != '0' ];then
|
||||
useradd $username
|
||||
ssh -p $host2_port $host2 "useradd $username"
|
||||
#ssh -p $host2_port $host2 "useradd $username"
|
||||
echo $password | passwd --stdin $username
|
||||
else
|
||||
echo "$username have been exits."
|
||||
|
|
|
@ -13,7 +13,7 @@ dir=$(cwd)
|
|||
id $username &> /dev/null
|
||||
if [ $? == '0' ];then
|
||||
userdel -r $username
|
||||
ssh -p $host2_port $host2 "userdel -r $username"
|
||||
#ssh -p $host2_port $host2 "userdel -r $username"
|
||||
else
|
||||
echo "$username is not exist."
|
||||
fi
|
||||
|
|
|
@ -22,8 +22,4 @@ urlpatterns = patterns('',
|
|||
(r'^downKey/$', views.downKey),
|
||||
(r'^chgPass/$', views.chgPass),
|
||||
(r'^chgKey/$', views.chgKey),
|
||||
(r'^chgPptp/$', views.chgPptp),
|
||||
(r'^chgOpenvpn/$', views.chgOpenvpn),
|
||||
(r'^addPptp/$', views.addPptp),
|
||||
(r'^addOpenvpn/$', views.addOpenvpn),
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue