LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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-14-2009, 06:27 AM   #1
suryashikha
LQ Newbie
 
Registered: Oct 2009
Posts: 6

Rep: Reputation: 0
How to allow access to some commands having root privleges to be run bu non root user


Hi
I am new to unix/linux and i have a mjor assignment. i have to find ways to run particular commands which can be run only by root from a non root user. I know sudo is one of the way but i need some diffrent approach.


Please help..
Regards
shikika
 
Old 10-14-2009, 06:29 AM   #2
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Nagpur, India
Distribution: Cent OS 5/6, Ubuntu Server 10.04
Posts: 4,627

Rep: Reputation: Disabled
What different approach? What is your main goal? sudo is the best possible way for it. Another way is to add users to root group and add permissions on the command for the group. But this is not definitely the best way and sudo is something you should be looking at.
 
Old 10-14-2009, 07:07 PM   #3
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,261

Rep: Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028
Concur with linuxlover.chaitanya; explain why sudo is insufficient. Its exactly the situation sudo was designed for.
 
Old 10-14-2009, 07:22 PM   #4
lutusp
Member
 
Registered: Sep 2009
Distribution: Fedora
Posts: 835

Rep: Reputation: 101Reputation: 101
Quote:
Originally Posted by suryashikha View Post
Hi
I am new to unix/linux and i have a mjor assignment. i have to find ways to run particular commands which can be run only by root from a non root user. I know sudo is one of the way but i need some diffrent approach.


Please help..
Regards
shikika
Is this homework? Have you read the man page for setuid? This is an example where, if it's homework, go ahead and read about setuid, but if this is practice, don't do it unless you are very knowledgeable and a bit reckless.
 
Old 10-14-2009, 07:28 PM   #5
J.W.
LQ Veteran
 
Registered: Mar 2003
Location: Milwaukee, WI
Distribution: Mint
Posts: 6,642

Rep: Reputation: 69
Agreed..... why do you reject sudo? Its purpose is to do exactly what you describe
 
Old 10-30-2009, 10:23 AM   #6
suryashikha
LQ Newbie
 
Registered: Oct 2009
Posts: 6

Original Poster
Rep: Reputation: 0
No its not a homework. Installing of sudo is not allowed tats y i have to cum up with diffrent approach.
 
Old 10-30-2009, 01:34 PM   #7
tredegar
Guru
 
Registered: May 2003
Location: London, UK
Distribution: Ubuntu 10.04, mostly
Posts: 6,007

Rep: Reputation: 367Reputation: 367Reputation: 367Reputation: 367
If it's "not allowed", then perhaps you should ask the owner / administrator of the system to help you.

Have you read the LQ Rules ?
 
Old 10-31-2009, 01:33 AM   #8
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Nagpur, India
Distribution: Cent OS 5/6, Ubuntu Server 10.04
Posts: 4,627

Rep: Reputation: Disabled
Quote:
Originally Posted by suryashikha View Post
No its not a homework. Installing of sudo is not allowed tats y i have to cum up with diffrent approach.
What distribution are you using? sudo is most probably installed by default on most of the distros.
But yes, administrator can restrict its usage to limited users of his/her choice. And if you are not one of them, use the system he wants you to use. No member here will help you if you are hacking into his system.
 
Old 10-31-2009, 01:05 PM   #9
suryashikha
LQ Newbie
 
Registered: Oct 2009
Posts: 6

Original Poster
Rep: Reputation: 0
I think i gave the wrong idea. I have to come up with a solution to run some commands which require root privleges when sudo is not installed/ or cannot be installed. I think setuid is the only method and i have implemented a soultion with it. Thanks for helping.
 
  


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
How to ssh as root to a workstation and then run commands as another user. martinhb Linux - Security 5 06-10-2009 10:04 PM
Grant normal user to run certain script with root access cdestiny Linux - Server 4 09-30-2008 02:42 AM
Giving a user (not a root) an access to some system commands asschay Linux - Newbie 8 09-08-2005 05:53 PM
How a ordinary user can run commands having only root privilige in C? shivaligupta Programming 1 01-31-2005 04:24 AM
im in user mode and cant run hdparm and ifconfig commands, but if im root, i can. kublador Linux - Newbie 2 09-12-2003 08:27 AM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration