Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
J
jumpserver
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ops
jumpserver
Commits
a19a8e86
Commit
a19a8e86
authored
Aug 15, 2014
by
guanghongwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
去掉备份冗余
parent
8feb7741
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
14 additions
and
20 deletions
+14
-20
chgpass.sh
chgpass.sh
+2
-2
genkey.sh
genkey.sh
+5
-5
jumpserver.sh
jumpserver.sh
+2
-2
shell.conf
shell.conf
+3
-3
sudodel.sh
sudodel.sh
+0
-2
useradd.sh
useradd.sh
+1
-1
userdel.sh
userdel.sh
+1
-1
urls.py
webroot/AutoSa/AutoSa/urls.py
+0
-4
No files found.
chgpass.sh
View file @
a19a8e86
...
@@ -18,4 +18,4 @@ fi
...
@@ -18,4 +18,4 @@ fi
echo
"
$password
"
| passwd
--stdin
"
$username
"
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\""
\ No newline at end of file
\ No newline at end of file
genkey.sh
View file @
a19a8e86
...
@@ -25,13 +25,13 @@ fi
...
@@ -25,13 +25,13 @@ fi
gen_key
${
password
}
gen_key
${
password
}
mkdir
-p
/home/
${
user
}
/.ssh
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
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
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
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"
\ No newline at end of file
\ No newline at end of file
jumpserver.sh
View file @
a19a8e86
#!/bin/bash
#!/bin/bash
if
[
$USER
=
'
yolu
'
]
||
[
$USER
==
'root'
]
;
then
if
[
$USER
=
'
admin
'
]
||
[
$USER
==
'root'
]
;
then
echo
""
echo
""
else
else
python /opt/jumpserver/jumpserver.pyo
python /opt/jumpserver/jumpserver.pyo
if
[
$USER
==
'guanghongwei'
]
||
[
$USER
==
'liufuhua'
]
;
then
if
[
$USER
==
'guanghongwei'
]
;
then
echo
echo
else
else
exit
3
exit
3
...
...
shell.conf
View file @
a19a8e86
...
@@ -2,5 +2,5 @@
...
@@ -2,5 +2,5 @@
host
=
127
.
0
.
0
.
1
host
=
127
.
0
.
0
.
1
ldapassword
=
VNLqNCjpNBIetEoCA2h3
ldapassword
=
VNLqNCjpNBIetEoCA2h3
host2
=
172
.
16
.
2
.
74
#host2=172.16.2.74
host2_port
=
2001
#
host2_port
=
2001
\ No newline at end of file
\ No newline at end of file
sudodel.sh
View file @
a19a8e86
...
@@ -14,6 +14,5 @@ if [ $? == '0' ];then
...
@@ -14,6 +14,5 @@ if [ $? == '0' ];then
userdel
-r
$username
userdel
-r
$username
else
else
echo
"
$username
is not exist."
echo
"
$username
is not exist."
exit
3
fi
fi
ldapdelete
-x
-h
$host
-D
"cn=admin,dc=yolu,dc=com"
-w
$ldapassword
"cn=
$username
,ou=Sudoers,dc=yolu,dc=com"
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
useradd.sh
View file @
a19a8e86
...
@@ -20,7 +20,7 @@ fi
...
@@ -20,7 +20,7 @@ fi
id
$username
&> /dev/null
id
$username
&> /dev/null
if
[
$?
!=
'0'
]
;
then
if
[
$?
!=
'0'
]
;
then
useradd
$username
useradd
$username
ssh
-p
$host2_port
$host2
"useradd
$username
"
#
ssh -p $host2_port $host2 "useradd $username"
echo
$password
| passwd
--stdin
$username
echo
$password
| passwd
--stdin
$username
else
else
echo
"
$username
have been exits."
echo
"
$username
have been exits."
...
...
userdel.sh
View file @
a19a8e86
...
@@ -13,7 +13,7 @@ dir=$(cwd)
...
@@ -13,7 +13,7 @@ dir=$(cwd)
id
$username
&> /dev/null
id
$username
&> /dev/null
if
[
$?
==
'0'
]
;
then
if
[
$?
==
'0'
]
;
then
userdel
-r
$username
userdel
-r
$username
ssh
-p
$host2_port
$host2
"userdel -r
$username
"
#
ssh -p $host2_port $host2 "userdel -r $username"
else
else
echo
"
$username
is not exist."
echo
"
$username
is not exist."
fi
fi
...
...
webroot/AutoSa/AutoSa/urls.py
View file @
a19a8e86
...
@@ -22,8 +22,4 @@ urlpatterns = patterns('',
...
@@ -22,8 +22,4 @@ urlpatterns = patterns('',
(
r'^downKey/$'
,
views
.
downKey
),
(
r'^downKey/$'
,
views
.
downKey
),
(
r'^chgPass/$'
,
views
.
chgPass
),
(
r'^chgPass/$'
,
views
.
chgPass
),
(
r'^chgKey/$'
,
views
.
chgKey
),
(
r'^chgKey/$'
,
views
.
chgKey
),
(
r'^chgPptp/$'
,
views
.
chgPptp
),
(
r'^chgOpenvpn/$'
,
views
.
chgOpenvpn
),
(
r'^addPptp/$'
,
views
.
addPptp
),
(
r'^addOpenvpn/$'
,
views
.
addOpenvpn
),
)
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment