LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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


Reply
  Search this Thread
Old 10-07-2003, 05:12 AM   #1
pk21
Member
 
Registered: Jun 2002
Location: Netherlands - Amsterdam
Distribution: RedHat 9
Posts: 549

Rep: Reputation: 30
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/....
 
Old 10-07-2003, 05:16 AM   #2
arunshivanandan
Member
 
Registered: May 2003
Location: Kerala,India
Distribution: RedHat,Mandrake,Debian
Posts: 643

Rep: Reputation: 30
chmod ugo+x /bin/...............,right??
ugo is user.group.other x is for execute.(r and w for read and write)
 
Old 10-07-2003, 05:39 AM   #3
ehdwuld
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: Reputation: 30
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
 
Old 10-07-2003, 06:52 AM   #4
pk21
Member
 
Registered: Jun 2002
Location: Netherlands - Amsterdam
Distribution: RedHat 9
Posts: 549

Original Poster
Rep: Reputation: 30
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.
 
Old 10-07-2003, 08:06 AM   #5
ehdwuld
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: Reputation: 30
chmod 777
gives read wite execute to all users
 
Old 10-07-2003, 08:18 AM   #6
pk21
Member
 
Registered: Jun 2002
Location: Netherlands - Amsterdam
Distribution: RedHat 9
Posts: 549

Original Poster
Rep: Reputation: 30
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?
 
Old 10-07-2003, 08:30 AM   #7
ehdwuld
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: Reputation: 30
http://www.tldp.org/LDP/intro-linux/...ect_03_04.html

about half way down this page may help
 
Old 10-07-2003, 08:53 AM   #8
adz
Senior Member
 
Registered: Jun 2003
Location: Sydney
Distribution: Debian, FreeBSD
Posts: 1,713

Rep: Reputation: 53
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Restricting Editing in Sudo (Advanced Sudo Question) LinuxGeek Linux - Software 4 11-04-2006 04:20 PM
About sudo alnreddy Linux - Security 3 06-13-2005 01:53 PM
su and sudo muman Linux - Security 9 12-30-2004 11:55 AM
need help with sudo mla Linux - Software 4 10-02-2003 12:05 PM
sudo? nabil Linux - Security 1 02-12-2001 02:18 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration