Xnomad Posted June 27, 2005 Report Share Posted June 27, 2005 (edited) Hi, I really want to be able to run a script as root as I can't be bothered doing sudo and then typing the long commands into my terminal. Here is the deal. I have encrypted containers that I need to mount quite frequently and it would be nicer to just have a script do this. My encrypted containers are in bcyrpt so I have to usually run the following line: sudo bctools mount -u xnomad -g xnomad /mnt/win/win_e/hurricane.jbc /mnt/hurricane I have tried wirting a script with the above and few more lines to mount the other containers and then get it to run as root. so I did the following: chown root:root myScript chmod 555 myScript chmod a+s myScript to set the SUID as root, I've also tried a+s and o+s ls -l myScript -r-sr-sr-x 1 root root 31 Jun 27 13:10 myScript So from what I understand I have set my script to run as root however whenever I do ./myScript it says I don't have permissions to mount or make directories in the /mnt Any ideas? Now I understand that suid root scripts can be a security loophole but surely if others can't write to it then it's safe? Edited June 27, 2005 by Xnomad Quote Link to comment Share on other sites More sharing options...
theYinYeti Posted June 27, 2005 Report Share Posted June 27, 2005 A script can never be "suid-ed". You have to use sudo. Yves. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.