Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
etersoft-admin-essentials
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
etersoft-admin-essentials
Commits
b0e61d2f
Commit
b0e61d2f
authored
Aug 07, 2015
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add rooter code
parent
ab0091ba
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
73 additions
and
0 deletions
+73
-0
get_ssh_pubkey.sh
rooter/get_ssh_pubkey.sh
+28
-0
rooter.sh
rooter/rooter.sh
+45
-0
No files found.
rooter/get_ssh_pubkey.sh
0 → 100755
View file @
b0e61d2f
#!/bin/sh
# Print out user's pub key
fatal
()
{
echo
"Error:
$@
"
exit
1
}
[
"
$UID
"
=
0
]
||
fatal
"Run me only as root"
USERNAME
=
$1
[
-n
"
$USERNAME
"
]
||
fatal
"Usage:
$0
username"
if
[
"
$USERNAME
"
=
"root"
]
;
then
HOMEDIR
=
/root
else
HOMEDIR
=
/home/
$USERNAME
fi
USERKEY
=
$HOMEDIR
/.ssh/id_dsa.pub
[
-r
"
$USERKEY
"
]
||
USERKEY
=
$HOMEDIR
/.ssh/id_rsa.pub
#[ -r "$USERKEY" ] || fatal "Can't read ssh key $USERKEY"
cat
$USERKEY
rooter/rooter.sh
0 → 100755
View file @
b0e61d2f
#!/bin/sh
fatal
()
{
echo
"Error:
$@
"
exit
1
}
[
"
$1
"
=
"-c"
]
||
fatal
"Run me only via ssh"
shift
run
()
{
case
"
$1
"
in
""
|
"help"
)
echo
"Welcome to Etersoft rooter!"
echo
"Available commands:"
echo
" get pubkey USER"
#echo " allow USER HOST [VEID]"
#echo " list hosts"
#echo " list host veid"
exit
;;
"get"
)
shift
case
"
$1
"
in
"pubkey"
)
shift
sudo
/home/rooter/bin/get_ssh_pubkey.sh
"
$1
"
;;
*
)
fatal
"Unknown command get
$1
"
;;
esac
;;
*
)
echo
"Etersoft rooter (c) 2015"
echo
"Unknown command
$*
"
exit
1
;;
esac
}
run
$*
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