I have a simple command that I want to be able to perform as a user, but it requires root permissions. I suspect that this is a case for the "SUID"-bit, but I've never used it.
This is what I've tried:
aioobe@e6510:~/bin$ sudo -s
root@e6510:~/bin# cat -> spindown_baydrive
#!/bin/bash
/sbin/hdparm -Y /dev/sdb
root@e6510:~/bin# chmod +x spindown_baydrive
root@e6510:~/bin# chmod ug+s spindown_baydrive
root@e6510:~/bin# exit
aioobe@e6510:~/bin$ ./spindown_baydrive
/dev/sdb: Permission denied
aioobe@e6510:~/bin$
aioobe@e6510:~/bin$ ls -la spindown_baydrive
-rwsr-sr-x 1 root root 37 2011-01-31 09:59 spindown_baydrive
Any suggestions?