Tauop / sshGate

Tools to configure and use a ssh proxy server
GNU General Public License v2.0
41 stars 12 forks source link

Configure sudo #27

Open jgoffaux opened 13 years ago

jgoffaux commented 13 years ago

Hello,

During setup, if you select 'N' to configure sudo The treatment will still try to configure it.

[..]
Do users have to accept TOS when connecting for the first time [Y] ?   
Allow remote command [Y] ?   
Allow remote administration CLI [Y] nfigure sudo with NOPASSWD to launch remote admin CLI [Y] ?  N

- Reload configuration ... OK
- Installing sshGate ... OK
- Generate default sshkey pair ... OK
- Setup files permissions ... OK
- Install archive cron ... OK
- configure /etc/sudoers ... ./install.sh: line 203: /etc/sudoers: Aucun fichier ou dossier de ce type
mv: impossible d'évaluer « /tmp/sudoers.26708 »: Aucun fichier ou dossier de ce type
OK

Thanks

Tauop commented 13 years ago

I have to remove this. This project has to not be dependent of sudo.

Tauop commented 13 years ago

Can you add this patch, run install.sh and return me the result pls ?

tauop@Tauopbox:/tmp$ diff -au install.sh.orig install.sh
--- install.sh.orig     2011-07-19 12:45:12.254033943 +0200
+++ install.sh  2011-07-19 12:46:08.293300387 +0200
@@ -196,6 +196,7 @@
   chmod +x /etc/cron.monthly/archive-log.sh
 OK

+set -x
 if [ "${SSHGATE_USE_REMOTE_ADMIN_CLI}" = 'Y' -a "${action}" = 'install' ]; then
   DOTHIS 'configure /etc/sudoers'
     file="/tmp/sudoers.${RANDOM}"
@@ -208,6 +209,8 @@
   OK
 fi

+set +x
+
 if [ -z "$( ls -1 "${SSHGATE_DIR_USERS}" )" ]; then
   # FIXME: ugly => load all sshGate, like the CLI :-(
   __SSHGATE_SETUP__=
jgoffaux commented 13 years ago

Is it possible that this is due to 'dash':

root@bastion:/opt/sshgate# ls -ail /bin/sh 8200 lrwxrwxrwx 1 root root 4 18 juil. 13:13 /bin/sh -> dash

I run the test and send it in a few days

Thanks

jgoffaux commented 13 years ago

Hello,

Here's the back:

Configure sudo with NOPASSWD to launch remote admin CLI [N] ?

- Reload configuration ... OK
- Installing sshGate ... OK
- Generate default sshkey pair ... OK
- Setup files permissions ... OK
- Install archive cron ... OK
+ '[' Y = Y -a install = install ']'
+ DOTHIS 'configure /etc/sudoers'
+ MESSAGE --no-break --no-indent -- '- configure /etc/sudoers ... '
+ local do_print=true do_log=true do_indent=true 'cbreak=\n'
+ local msg= date=
++ date '+[%D %T]'
+ date='[07/21/11 13:41:14]'
+ '[' true ']'
+ '[' 4 -eq 0 ']'
+ case "$1" in
+ shift
+ cbreak=
+ '[' true ']'
+ '[' 3 -eq 0 ']'
+ case "$1" in
+ shift
+ do_indent=false
+ '[' true ']'
+ '[' 2 -eq 0 ']'
+ case "$1" in
+ shift
+ break
+ msg='- configure /etc/sudoers ... '
+ '[' false = true ']'
+ '[' true = true ']'
+ printf %s '- configure /etc/sudoers ... '
- configure /etc/sudoers ... + '[' true = true -a -f '' ']'
+ __IN_DOTHIS__=true
+ file=/tmp/sudoers.7359
+ '[' N = Y ']'
+ sudo_no_passwd=
+ grep -v '^sshgate '
./install.sh: line 204: /etc/sudoers: Aucun fichier ou dossier de ce type
+ mv /tmp/sudoers.7359 /etc/sudoers
mv: impossible d'évaluer « /tmp/sudoers.7359 »: Aucun fichier ou dossier de ce type
+ echo 'sshgate ALL=(root) /opt/sshgate/bin/sshgate-cli'
+ chmod 0440 /etc/sudoers
+ rm -f /tmp/sudoers.7359
+ OK
+ '[' true = true ']'
+ MESSAGE --no-date --no-indent -- OK
+ local do_print=true do_log=true do_indent=true 'cbreak=\n'
+ local msg= date=
++ date '+[%D %T]'
+ date='[07/21/11 13:41:14]'
+ '[' true ']'
+ '[' 4 -eq 0 ']'
+ case "$1" in
+ shift
+ date=
+ '[' true ']'
+ '[' 3 -eq 0 ']'
+ case "$1" in
+ shift
+ do_indent=false
+ '[' true ']'
+ '[' 2 -eq 0 ']'
+ case "$1" in
+ shift
+ break
+ msg=OK
+ '[' false = true ']'
+ '[' true = true ']'
+ printf '%s\n' OK
OK
+ '[' true = true -a -f '' ']'
+ __IN_DOTHIS__=false
+ set +x

root@bastion:/bin# ls -ail sh 286728 lrwxrwxrwx 1 root root 4 21 juil. 13:17 sh -> dash

Tauop commented 13 years ago

Seems you don't have /etc/sudoers file. I will remove sudo dependency (it sucks)