Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place! |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
10-07-2003, 05:12 AM
|
#1
|
Member
Registered: Jun 2002
Location: Netherlands - Amsterdam
Distribution: RedHat 9
Posts: 549
Rep:
|
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/....
|
|
|
10-07-2003, 05:16 AM
|
#2
|
Member
Registered: May 2003
Location: Kerala,India
Distribution: RedHat,Mandrake,Debian
Posts: 643
Rep:
|
chmod ugo+x /bin/...............,right??
ugo is user.group.other x is for execute.(r and w for read and write)
|
|
|
10-07-2003, 05:39 AM
|
#3
|
Member
Registered: Jul 2003
Distribution: Currently Suse 11.1 but have RH7,8,9 / Fedora 7,8_64,9_64,&10_64
Posts: 634
Rep:
|
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
|
|
|
|
10-07-2003, 06:52 AM
|
#4
|
Member
Registered: Jun 2002
Location: Netherlands - Amsterdam
Distribution: RedHat 9
Posts: 549
Original Poster
Rep:
|
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.
|
|
|
10-07-2003, 08:06 AM
|
#5
|
Member
Registered: Jul 2003
Distribution: Currently Suse 11.1 but have RH7,8,9 / Fedora 7,8_64,9_64,&10_64
Posts: 634
Rep:
|
chmod 777
gives read wite execute to all users
|
|
|
10-07-2003, 08:18 AM
|
#6
|
Member
Registered: Jun 2002
Location: Netherlands - Amsterdam
Distribution: RedHat 9
Posts: 549
Original Poster
Rep:
|
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?
|
|
|
10-07-2003, 08:30 AM
|
#7
|
Member
Registered: Jul 2003
Distribution: Currently Suse 11.1 but have RH7,8,9 / Fedora 7,8_64,9_64,&10_64
Posts: 634
Rep:
|
|
|
|
10-07-2003, 08:53 AM
|
#8
|
Senior Member
Registered: Jun 2003
Location: Sydney
Distribution: Debian, FreeBSD
Posts: 1,713
Rep:
|
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 01:02 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|