去掉备份冗余

pull/1/head
guanghongwei 2014-08-15 15:43:39 +08:00
parent 8feb77416d
commit a19a8e86df
8 changed files with 11 additions and 16 deletions

View File

@ -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\""

View 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"
#ssh -p ${host2_port} ${host2} "chown -R $user:$user /home/$user/.ssh"

View File

@ -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

View File

@ -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

View 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"

View 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."

View File

@ -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

View File

@ -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),
)