LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 03-24-2010, 04:43 AM   #1
gazolinia
LQ Newbie
 
Registered: Mar 2010
Posts: 7

Rep: Reputation: 0
Unhappy Need to call chroot under normal unprevileged user !!


Its been two days over, after my search started . But I didn't find answer any where ?. I need to call chroot as part of normal user, but to my surprise it can only be called by SUper user with CAP_SYS_CHROOT capabilities. I am not sure how to add this capability to my user . Please help me in solving my situation.
 
Old 03-24-2010, 07:26 AM   #2
rizhun
Member
 
Registered: Jun 2005
Location: England
Distribution: Ubuntu, SLES, AIX
Posts: 268

Rep: Reputation: 47
Have you tried:

Code:
$ sudo chroot
?
 
Old 03-24-2010, 07:34 AM   #3
LouRobytes
Member
 
Registered: Mar 2010
Location: Nova Scotia, Canada
Distribution: Ubuntu & Fedora
Posts: 189

Rep: Reputation: 44
I believe that if you add your normal user to the 'root' group you can accomplish what you're after. This can be done from a command line, or through the Users and Group Manager provided by your distro.

Cheers, Lou
 
0 members found this post helpful.
Old 03-24-2010, 04:43 PM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by LouRobytes View Post
I believe that if you add your normal user to the 'root' group you can accomplish what you're after.
This is bad advice. OP: please do not do this.
 
Old 03-24-2010, 05:20 PM   #5
impert
Member
 
Registered: Feb 2009
Posts: 282

Rep: Reputation: 54
Quote:
Originally Posted by gazolinia View Post
Its been two days over, after my search started . But I didn't find answer any where ?. I need to call chroot as part of normal user, but to my surprise it can only be called by SUper user with CAP_SYS_CHROOT capabilities. I am not sure how to add this capability to my user . Please help me in solving my situation.
Why on earth do you "need" to do that? Your system is configured that way for good reason, my advice would be to leave it as it is.
You haven't said what distro you are using. If sudo is not installed then you won't be able to use the 2nd poster's suggestion until it is installed. You can still use su to become root. If you install or have sudo, then you can use visudo (and nothing else!) to edit the /etc/sudoers file to give normal user sudo privileges eg:
Code:
gazolinia ALL=(ALL) ALL
Adding NOPASSWD to this line will, I think, give you what you asked for, but I haven't tried it as I can see no good reason to do so.
 
Old 03-24-2010, 05:27 PM   #6
LouRobytes
Member
 
Registered: Mar 2010
Location: Nova Scotia, Canada
Distribution: Ubuntu & Fedora
Posts: 189

Rep: Reputation: 44
unSpawn,

I've never done before what I described (not advised) because I know the powers of root. Given what gazolinia asked for, this is the only solution I can think of. I agree that it is not a prudent way to go and should have cautioned him/her. but since I'm new to LQ, I'm not sure how much info to include in a response.

Thank you for indicating that I overstepped.

Cheers. Lou

Last edited by LouRobytes; 03-24-2010 at 05:30 PM. Reason: clarification
 
1 members found this post helpful.
Old 03-24-2010, 05:39 PM   #7
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
NP, at least you know and clarified it's not standard procedure, WD.
 
Old 03-24-2010, 07:11 PM   #8
LouRobytes
Member
 
Registered: Mar 2010
Location: Nova Scotia, Canada
Distribution: Ubuntu & Fedora
Posts: 189

Rep: Reputation: 44
Hate to advertise my ignorance but don't know 'NP' and 'WD'.

Don't yell at me, Lou
 
Old 03-24-2010, 07:40 PM   #9
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
Quote:
Originally Posted by LouRobytes View Post
Hate to advertise my ignorance but don't know 'NP' and 'WD'.

Don't yell at me, Lou
No problem; well done.
 
Old 03-24-2010, 11:48 PM   #10
gazolinia
LQ Newbie
 
Registered: Mar 2010
Posts: 7

Original Poster
Rep: Reputation: 0
Hi,

Great thanks for your immediate response. Here I am not calling chroot in command line, if so I might have tried suid binary .But I call chroot() method from a perl script . This perl script needs to run under normal user . Currently the point where I stand is I must run the perl script under un previleged user, but it should do chroot. Seems little wierd right , but this is what my application requires now . Adding capablility CAP_SYS_CHROOT to the normal user I guess must solve my requirement, this is what man page of chroot says. But I am not sure how to add this capablity to my user.

Hope you got my requirements. Thanks in advance .

Thanks
Jai
 
Old 03-29-2010, 05:06 PM   #11
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
FUP: http://www.linuxforums.org/forum/lin...tml#post770983
 
  


Reply



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 run daemon process being a normal user [not root user]. narendra1310 Linux - Software 1 10-26-2009 09:48 AM
super user privileges check for a normal user in bash script freeindy Programming 2 08-01-2008 06:08 AM
Giving user 'www-data' same permissions as normal user MikeOfAustin Linux - Software 5 06-08-2007 02:50 AM
Call external prog from withing chroot jail The_JinJ Linux - General 2 12-13-2005 04:38 PM
Games runs slow as normal user, but fast as root user mcore Linux - Software 2 06-07-2004 11:11 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 12:03 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