From a19a8e86dfa10663c507e8b9419d1f5cda85a762 Mon Sep 17 00:00:00 2001 From: guanghongwei Date: Fri, 15 Aug 2014 15:43:39 +0800 Subject: [PATCH] =?UTF-8?q?=E9=8D=98=E7=BB=98=E5=B8=80=E6=BE=B6=E5=9B=A6?= =?UTF-8?q?=E5=94=A4=E9=8D=90=E6=A4=BE=E7=B6=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- chgpass.sh | 2 +- genkey.sh | 8 ++++---- jumpserver.sh | 4 ++-- shell.conf | 4 ++-- sudodel.sh | 1 - useradd.sh | 2 +- userdel.sh | 2 +- webroot/AutoSa/AutoSa/urls.py | 4 ---- 8 files changed, 11 insertions(+), 16 deletions(-) diff --git a/chgpass.sh b/chgpass.sh index 945cfc260..624f512be 100644 --- a/chgpass.sh +++ b/chgpass.sh @@ -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 diff --git a/genkey.sh b/genkey.sh index 8226a047d..2d7cf1359 100644 --- a/genkey.sh +++ b/genkey.sh @@ -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 diff --git a/jumpserver.sh b/jumpserver.sh index c1d63293d..57a3b4e9b 100644 --- a/jumpserver.sh +++ b/jumpserver.sh @@ -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 diff --git a/shell.conf b/shell.conf index 606e7d365..aa348d7eb 100644 --- a/shell.conf +++ b/shell.conf @@ -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 diff --git a/sudodel.sh b/sudodel.sh index f06fe047d..294a30852 100644 --- a/sudodel.sh +++ b/sudodel.sh @@ -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 diff --git a/useradd.sh b/useradd.sh index 31ac11cb2..68d2b5cdd 100644 --- a/useradd.sh +++ b/useradd.sh @@ -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." diff --git a/userdel.sh b/userdel.sh index 13fc74d46..51eefe7c6 100644 --- a/userdel.sh +++ b/userdel.sh @@ -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 diff --git a/webroot/AutoSa/AutoSa/urls.py b/webroot/AutoSa/AutoSa/urls.py index c46b4cb05..26e545d65 100644 --- a/webroot/AutoSa/AutoSa/urls.py +++ b/webroot/AutoSa/AutoSa/urls.py @@ -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), )