Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
domainepublic
alternc
Commits
93dde12e
Commit
93dde12e
authored
Aug 04, 2009
by
Antoine Beaupré
Browse files
fix alternc-slaves detection and warn the user if there's no key to authorize
parent
049042dd
Changes
1
Hide whitespace changes
Inline
Side-by-side
debian/alternc.postinst
View file @
93dde12e
...
...
@@ -158,19 +158,26 @@ EOF
# multi-server configuration: we create an alternc account with
# authorized keys. since this is the master, we do not give him a
# valid shell, but we still need the user for proper perms
if
[
!
-z
"
$ALTERNC_SLAVES
"
&&
"
$ALTERNC_SLAVES
"
!=
"localhost"
]
;
then
if
[
!
-z
"
$ALTERNC_SLAVES
"
]
&&
[
"
$ALTERNC_SLAVES
"
!=
"localhost"
]
;
then
if
!
grep
-q
alternc /etc/passwd
;
then
echo
"Creating alternc account"
adduser
--quiet
--system
--uid
342
--home
$ALTERNC_LOC
--shell
/bin/false
--ingroup
adm alternc
fi
key
=
`
cat
~root/.ssh/id_dsa.pub
`
if
!
grep
-q
"
$key
"
$ALTERNC_LOC
/.ssh/authorized_keys
;
then
echo
"Authorizing root ssh key to access the common alternc account"
mkdir
-p
$ALTERNC_LOC
/.ssh
echo
"
$key
"
>>
$ALTERNC_LOC
/.ssh/authorized_keys
chown
-R
alternc:adm
$ALTERNC_LOC
/.ssh
chmod
-R
og-rwx
$ALTERNC_LOC
/.ssh
if
[
-r
~root/.ssh/id_dsa.pub
]
;
then
key
=
`
cat
~root/.ssh/id_dsa.pub
`
if
!
grep
-q
"
$key
"
$ALTERNC_LOC
/.ssh/authorized_keys
;
then
echo
"Authorizing root ssh key to access the common alternc account"
mkdir
-p
$ALTERNC_LOC
/.ssh
echo
"
$key
"
>>
$ALTERNC_LOC
/.ssh/authorized_keys
chown
-R
alternc:adm
$ALTERNC_LOC
/.ssh
chmod
-R
og-rwx
$ALTERNC_LOC
/.ssh
fi
else
echo
"No SSH key in "
~root/.ssh/id_dsa.pub
echo
"create one and reconfigure alternc to propagate SSH keys"
fi
else
echo
"AlternC slaves not configured (
$ALTERNC_SLAVES
)"
fi
# /var/alternc/dns/d/www.example.com
...
...
Write
Preview
Supports
Markdown
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