Index: scripts/lockdown.sh =================================================================== diff -u -r9b8e81e83ef067dff42206a6642a6d87086a6474 -rf51f9ce154a6891cb5bfd133409430e6800f0166 --- scripts/lockdown.sh (.../lockdown.sh) (revision 9b8e81e83ef067dff42206a6642a6d87086a6474) +++ scripts/lockdown.sh (.../lockdown.sh) (revision f51f9ce154a6891cb5bfd133409430e6800f0166) @@ -134,7 +134,25 @@ # Allow the denali user to execute specific commands as root. echo " +Defaults env_reset +Defaults mail_badpass +Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin" +Defaults use_pty +# 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 + +# All serviceuser to execute any command +serviceuser ALL=(ALL:ALL) ALL +%serviceuser ALL=(ALL:ALL) ALL + + # Allow the denali user to execute specific commands as root. denali ALL=(root) NOPASSWD: /usr/bin/bluetoothctl denali ALL=(root) NOPASSWD: /usr/bin/tee * @@ -163,7 +181,7 @@ denali ALL=(root) NOPASSWD: /bin/mkdir * denali ALL=(root) NOPASSWD: /usr/sbin/cryptsetup * denali ALL=(root) NOPASSWD: /sbin/mkfs.ext4 * -" >> /etc/sudoers +" > /etc/sudoers } ############################################################################ @@ -237,16 +255,33 @@ # None ############################################################################ function moveCustomerAppFiles() { - # Move the files + + # Unset the immutable attribute for all of the files in case we + # are rerunning this script. + chattr -R -i /home/cloud/* + chattr -R -i /home/denali/* + + # Move the files + if [ -d ~/cloudsync ]; then + rm -rf /home/cloud/cloudsync mv ~/cloudsync /home/cloud/ + fi + + if [ -f ~/denali ]; then + rm -f /home/denali/denali mv ~/denali /home/denali/ + fi + + if [ -d ~/scripts ]; then + rm -rf /home/denali/scripts mv ~/scripts /home/denali/ + fi - # Change the file owners. - chown -R cloud.cloud /home/cloud - chmod -R o-rwx /home/cloud - chown -R denali.denali /home/denali - chmod -R o-rwx /home/denali + # Change the file owners. + chown -R cloud.cloud /home/cloud + chmod -R o-rwx /home/cloud + chown -R denali.denali /home/denali + chmod -R o-rwx /home/denali } ############################################################################