i wrote a script that creates an encrypted loop, and mounts a filesystem image.
i dont want to have to become root every time i mount my encrypted file system, but the script needs root access to setup the loop (with the losetup command)
so i wrote my script, saved it. and as root...
chown 700 myUser /home/user/bin/script
chown user /home/user/bin/script
chmod +s /home/user/bin/script
(i also tried chmod u+s)
so why does the mount command complain that only root can do that!
i thought setting an executable as SUID ROOT made it run with root privilages ! ?
my scripts...
Code:
#!/bin/bash
/sbin/losetup -e aes /dev/loop1 /home/chris/encrypted.fs
mount /dev/loop1 /home/chris/secret/
Code:
#!/bin/bash
umount /dev/loop1
/sbin/losetup -d /dev/loop1