Jump to content

suid root script possible in LE 2005?


Recommended Posts

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 by Xnomad
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...