LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-25-2005, 11:00 PM   #16
quatsch
LQ Addict
 
Registered: Aug 2003
Location: New York, NY
Distribution: gentoo, gentooPPC
Posts: 1,661

Rep: Reputation: 48

you probably need to set the sticky bit. Find where chroot is (probably in /bin), go to the directory and then do
chmod +s chroot

After this, you should be able to execute chroot as a normal user.you can check with
chroot /
If this does not return an Operation not permitted message, you can use chroot as a normal user.

But if you don't have the needed binaries and libraries in the new root, you'll get error messages.
 
Old 01-25-2005, 11:12 PM   #17
novaprime
Member
 
Registered: Jan 2005
Posts: 39

Original Poster
Rep: Reputation: 15
ok, done that. now chroot says can't find /bin/bash
so I copied /bin/bash to ~/bin/bash and I got a permission denied, so I fixed the permissions to RWXR-XR-X on both the dir and file and it sayes can find /bin/bash again?

btw, whats the sticky bit do?
 
Old 01-25-2005, 11:18 PM   #18
quatsch
LQ Addict
 
Registered: Aug 2003
Location: New York, NY
Distribution: gentoo, gentooPPC
Posts: 1,661

Rep: Reputation: 48
when you set the sticky bit, the program is run with the privileges of the owner of the program. So since chroot is owned by root, when you set the sticky bit for it, a user can run it with the privileges of root (could be a security issue for some programs; not sure about chroot - you might want to check - though since you immediately move into the chroot environment and if you set it up to logout immediately after you are done, it should be all right).

The reason it says that it can't find /bin/bash is probably because you need a whole lot of other things to be able to read from the disk. Everything that is needed has to be in your new chroot environment. If you have diskspace to spare, you could start out with copying /bin, /lib, /usr/bin, /usr/lib, /etc over to your home directory. Then you could start whittling it down.
 
Old 01-25-2005, 11:28 PM   #19
novaprime
Member
 
Registered: Jan 2005
Posts: 39

Original Poster
Rep: Reputation: 15
hmm, the overhead of this option is starting to get to big. I think I will "chmod o-r / -r" instead (is that safe?)

btw, thanks for your help
 
Old 01-25-2005, 11:38 PM   #20
quatsch
LQ Addict
 
Registered: Aug 2003
Location: New York, NY
Distribution: gentoo, gentooPPC
Posts: 1,661

Rep: Reputation: 48
I think if you do that, nothing will run as normal user as it denies read access to all files. If this is not true, I think users will still have access to the files so long as they know the locations.

If you're worried about users writing or changing files they should not, that should already be taken care of when the system was set up. The important things are owned by root and normal users should not have write access to directories outside their home directories.

If there are particular directories/files you don't want normal users to even be able to read, you should deal with them individually.


BTW, don't forget to unset the sticky bit for chroot:
chmod -s chroot
 
Old 01-25-2005, 11:41 PM   #21
novaprime
Member
 
Registered: Jan 2005
Posts: 39

Original Poster
Rep: Reputation: 15
thanks
 
  


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
restrict/allow ssh users mike30188 Linux - Security 2 06-20-2005 08:37 PM
restrict space for some users in directories CleonII Linux - Security 5 02-25-2004 10:08 AM
Why did you experienced users of Unix change to unix over Windows? Laptop2250 Linux - General 11 10-28-2003 11:51 AM
Restrict Directories to users with SSH aeruzcar Linux - General 5 09-11-2003 03:28 PM
How to restrict email from users... Supp0rtLinux Linux - Software 1 01-08-2003 03:37 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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