LinuxQuestions.org
Visit Jeremy's Blog.
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: Gurgaon, India
Distribution: Cent OS 6/7
Posts: 4,631

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
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,355

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
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: 102Reputation: 102
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: Boise, ID
Distribution: Mint
Posts: 6,642

Rep: Reputation: 87
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
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
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: Gurgaon, India
Distribution: Cent OS 6/7
Posts: 4,631

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

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

All times are GMT -5. The time now is 07:25 AM.

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