From 3924ede8bba18013ac14bb7b14ac350d7983d293 Mon Sep 17 00:00:00 2001 From: Leonid Suprun Date: Sat, 24 Jan 2015 11:32:03 +0300 Subject: [PATCH 1/2] Do not overwrite default sudoers config --- install/ubuntu/sudoers.conf | 31 ----------------------------- install/ubuntu/sudoers.vestacp.conf | 1 + install/vst-install-ubuntu.sh | 4 ++-- 3 files changed, 3 insertions(+), 33 deletions(-) delete mode 100644 install/ubuntu/sudoers.conf create mode 100644 install/ubuntu/sudoers.vestacp.conf diff --git a/install/ubuntu/sudoers.conf b/install/ubuntu/sudoers.conf deleted file mode 100644 index 0e3058d18..000000000 --- a/install/ubuntu/sudoers.conf +++ /dev/null @@ -1,31 +0,0 @@ -# -# This file MUST be edited with the 'visudo' command as root. -# -# Please consider adding local content in /etc/sudoers.d/ instead of -# directly modifying this file. -# -# See the man page for details on how to write a sudoers file. -# -Defaults env_reset -Defaults mail_badpass -Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" -Defaults env_keep="VESTA" - -# Host alias specification - -# User alias specification - -# Cmnd alias specification - -# User privilege specification -root ALL=(ALL:ALL) ALL - -# Members of the admin group may gain root privileges -%admin ALL=(ALL) ALL - -# Allow members of group sudo to execute any command -%sudo ALL=(ALL:ALL) ALL - -# See sudoers(5) for more information on "#include" directives: - -#includedir /etc/sudoers.d diff --git a/install/ubuntu/sudoers.vestacp.conf b/install/ubuntu/sudoers.vestacp.conf new file mode 100644 index 000000000..fc1782282 --- /dev/null +++ b/install/ubuntu/sudoers.vestacp.conf @@ -0,0 +1 @@ +Defaults env_keep="VESTA" diff --git a/install/vst-install-ubuntu.sh b/install/vst-install-ubuntu.sh index cc461577a..25e0c64d7 100644 --- a/install/vst-install-ubuntu.sh +++ b/install/vst-install-ubuntu.sh @@ -535,9 +535,9 @@ echo 'LS_COLORS="$LS_COLORS:di=00;33"' >> /etc/profile echo "/sbin/nologin" >> /etc/shells # Sudo configuration -wget $CHOST/$VERSION/sudoers.conf -O /etc/sudoers +wget $CHOST/$VERSION/sudoers.vestacp.conf -O /etc/sudoers.d/vestacp wget $CHOST/$VERSION/sudoers.admin.conf -O /etc/sudoers.d/admin -chmod 440 /etc/sudoers +chmod 440 /etc/sudoers.d/vestacp chmod 440 /etc/sudoers.d/admin # NTP Synchronization From 57b91043699e58fa163d96229bba110a367219f2 Mon Sep 17 00:00:00 2001 From: Leonid Suprun Date: Sat, 24 Jan 2015 11:37:26 +0300 Subject: [PATCH 2/2] /etc/sudoers not modified during installation --- install/vst-install-ubuntu.sh | 5 ----- 1 file changed, 5 deletions(-) diff --git a/install/vst-install-ubuntu.sh b/install/vst-install-ubuntu.sh index 25e0c64d7..7f05f58df 100644 --- a/install/vst-install-ubuntu.sh +++ b/install/vst-install-ubuntu.sh @@ -300,11 +300,6 @@ mkdir -p $vst_backups/bind mkdir -p $vst_backups/vesta mkdir -p $vst_backups/home -# Backup sudoers -if [ -e '/etc/sudoers' ]; then - cp /etc/sudoers $vst_backups/ -fi - # Backup nginx service nginx stop > /dev/null 2>&1 if [ -e '/etc/nginx/nginx.conf' ]; then