sym
10-24-2001, 11:54 AM
I am trying to write some bash scripts, but some of the things I want them to do involve being root. I have not had a lot of luck becoming the su in the script, so I was wondering how other people did it.
Thanks!
Thanks!
|
Click to See Complete Forum and Search --> : Becoming su in a script sym 10-24-2001, 11:54 AM I am trying to write some bash scripts, but some of the things I want them to do involve being root. I have not had a lot of luck becoming the su in the script, so I was wondering how other people did it. Thanks! sans-hubris 10-24-2001, 12:53 PM Set the owner to root and execute as root. Checkout the man page for chown. [ 24 October 2001: Message edited by: Muad Dib --formerly ndogg ] sym 10-24-2001, 01:00 PM What I want to do is allow a non-root user to execute a script that performs a function that requires root permissions (mount a file system). I don't want to have to manually change to the superuser before I execute this script. Is there any way to do this? Strike 10-24-2001, 02:16 PM You can make it setuid root, but this is a severe security risk. Are you sure there isn't a better way of doing this? Generally you don't want normal users doing what the super-user should be doing. Granted, it can be annoying switching to root for things that are semi-routine such as installing/updating software, but for that I recommend sudo (http://www.courtesan.com/sudo) sym 10-24-2001, 02:31 PM It is mostly just mounting drives. I know that it is dangerous to allow the su access, but it is kind of a pain to have to go to the CL, su to root, then execute the script. I was hoping to just be able to click on it. I guess it probably isn't worth the security hole though. Stuka 10-24-2001, 05:37 PM Actually, unless I've lost my mind (which is always possible), you can set a drive to be user-mountable by setting up fstab correctly. I can't tell you how to do it, but I'm sure that the man pages can help! Strike 10-24-2001, 06:50 PM Just put "user" in the fourth field in /etc/fstab ... sym 10-25-2001, 09:01 AM Thanks! :) justlinux.com
Copyright Internet.com Inc. All Rights Reserved. |