LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   sudo (https://www.linuxquestions.org/questions/linux-newbie-8/sudo-101139/)

pk21 10-07-2003 04:12 AM

sudo
 
hi all

how can i give another user permission to execute a file that only should be run as root?
What chmod options do i have to enter?

chmod ???? /bin/....

arunshivanandan 10-07-2003 04:16 AM

chmod ugo+x /bin/...............,right??
ugo is user.group.other x is for execute.(r and w for read and write)

ehdwuld 10-07-2003 04:39 AM

I think it works like this




Quote:

chmod perm filename
(=change mode) Change the file access permission for the files you own (unless you are root in which case you can change any file). You can make a file accessible in three modes: read (r), write (w), execute (x) to three classes of users: owner (u), members of the group which owns the file (g), others on the system (o). Check the current access permissions using:
ls -l filename
If the file is accessible to all users in all modes it will show:
rwxrwxrwx
The first triplet shows the file permission for the owner of the file, the second for the group that owns the file, and the third for others ("the rest of the world"). A "no" permission is shown as "-".
When setting permissions, these symbols are used: "u"(=user or owner of the file), "g"(=group that owns the file), "o"(=others), "a" (=all, i.e., owner, group and others), "="(=set the permission to), "+"(=add the permission), "-"(=take away the permission), "r"(=permission to read the file), "w"=(write permission, meanning the permission to modify the file), "x"(=permission to execute the file).

For example, this command will add the permission to read the file junk to all (=user+group+others):
chmod a+r junk
This command will remove the permission to execute the file junk from others:
chmod o-x junk

pk21 10-07-2003 05:52 AM

That aint gonna work for me.

I want a user called test, run for example a script like kill as user root. Other users should't have root permissions on this file.

ehdwuld 10-07-2003 07:06 AM

chmod 777
gives read wite execute to all users

pk21 10-07-2003 07:18 AM

yes, ofcourse it does.

But i only want one user(called test) to execute a file as uid root. The other users may not have permissions to execute.

So i make the file:
chown root:test file

But what to do after that?

ehdwuld 10-07-2003 07:30 AM

http://www.tldp.org/LDP/intro-linux/...ect_03_04.html

about half way down this page may help

adz 10-07-2003 07:53 AM

You have to install the sudo package. If unsure whether it's installed, type sudo at the prompt and see if you get a "command not found" response. Once it's installed you have to edit the /etc/sudoers file and add the appropriate user to the file. There should be a root entry already and man sudo or man sudoers will have more info.


All times are GMT -5. The time now is 02:01 AM.