Commit a19a8e86 authored by guanghongwei's avatar guanghongwei

去掉备份冗余

parent 8feb7741
......@@ -18,4 +18,4 @@ fi
echo "$password" | passwd --stdin "$username"
ssh -p $host2_port $host2 "echo \"$password\" | passwd --stdin \"$username\""
\ No newline at end of file
#ssh -p $host2_port $host2 "echo \"$password\" | passwd --stdin \"$username\""
\ No newline at end of file
......@@ -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"
\ No newline at end of file
#ssh -p ${host2_port} ${host2} "chown -R $user:$user /home/$user/.ssh"
\ No newline at end of file
#!/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
\ No newline at end of file
#host2=172.16.2.74
#host2_port=2001
\ No newline at end of file
......@@ -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"
\ No newline at end of file
......@@ -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),
)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment