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
5499e3ce
Commit
5499e3ce
authored
Apr 06, 2016
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add_eterkey: fix
parent
af35be8d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
add_eterkey.sh
rooter/add_eterkey.sh
+4
-3
No files found.
rooter/add_eterkey.sh
View file @
5499e3ce
...
...
@@ -41,6 +41,7 @@ ssh $HOST echo || fatal "Host $HOST is not sshed"
SUDO
=
[
"
$UID
"
=
0
]
||
SUDO
=
"sudo"
HOSTSUDO
=
$SUDO
SSHOPT
=
""
# FIXME: почему-то в cat не раскрывается тильда!
#ADDKEYCMD="useradd $USERNAME ; su - $USERNAME -c 'mkdir -p ~/.ssh ; chmod 700 ~/.ssh ; touch ~/.ssh/authorized_keys ; chmod 600 ~/.ssh/authorized_keys' ; cat >> /home/$USERNAME/.ssh/authorized_keys"
...
...
@@ -55,7 +56,7 @@ add_key_cmd()
if
[
-z
"
$VEID
"
]
||
[
"
$VEID
"
=
0
]
;
then
echo
"Copy key for
$USERNAME
to host
$HOST
"
echo
"
$USERKEY
"
| docmd ssh
$HOST
"
$(
add_key_cmd
)
"
ssh
$HOST
$HOSTSUDO
ls
/home/
$USERNAME
/.ssh
-l
ssh
$
SSHOPT
$
HOST
$HOSTSUDO
ls
/home/
$USERNAME
/.ssh
-l
#ssh -i $USERKEY $USERNAME@$HOST ls ~/.ssh -l
# TODO (.gitconfig)
# git config --global user.email "you@example.com"
...
...
@@ -66,11 +67,11 @@ fi
# show containter list
if
[
"
$VEID
"
=
"-l"
]
;
then
docmd ssh
$HOST
$HOSTSUDO
vzlist
docmd ssh
$
SSHOPT
$
HOST
$HOSTSUDO
vzlist
exit
fi
# copy key in VEID container at host system
echo
"Copy key for
$USERNAME
to
$HOST
, VEID=
$VEID
"
SUDO
=
echo
"
$USERKEY
"
| ssh
$HOST
"
$HOSTSUDO
vzctl exec
$VEID
\"
$(
add_key_cmd
)
\"
"
echo
"
$USERKEY
"
| ssh
$
SSHOPT
$
HOST
"
$HOSTSUDO
vzctl exec
$VEID
\"
$(
add_key_cmd
)
\"
"
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