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 01-13-2009, 04:13 PM   #1
SuperDude123
Member
 
Registered: Nov 2008
Posts: 158

Rep: Reputation: 30
how to restrict users via chroot


I just setup my server, and I would like to know, how do I lock one specific user to their home directory (/mnt/hdb/userhome )? I also don't know how to compile, so if their is a guide that your going to show me, I will still get stuck :S
 
Old 01-13-2009, 04:22 PM   #2
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-14.2 on Lenovo Thinkpad W520
Posts: 7,096

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
I wouldn't use chroot for that purpose. You can set-up that user's account so that he or she does not belong to a "general" group like "users" but to another one instead, say "specific", then 'chown -R thatuser:specific /mnt/hdb/userhome'

[Edit]Sorry I did not realize that with my proposal that user will still be able to access files with read or write rights for "all". Wait for a better answer.

Last edited by Didier Spaier; 01-13-2009 at 04:26 PM.
 
Old 02-04-2009, 01:00 PM   #3
crabber338
LQ Newbie
 
Registered: Nov 2005
Posts: 18

Rep: Reputation: 0
You can invoke restricted bash (or rbash), to keep the user from cd'ing.

Never had much luck with chroot... Only as a way to restrict FTP users, but not as an ssh login.

Slackware doesn't come with rbash by default, so you'll have to go to /etc/bin and 'cp bash rbash'. You can then edit the /etc/passwd to have rbash instead of bash.

However, if you want to restrict to the home directory, while retaining cd (change dir) access, I don't know of an easy way to do this. Perhaps somebody has a better method...
 
  


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 restrict users in VSftpd ram_rajavarapu Linux - Server 1 10-15-2008 08:43 PM
ProFTPd restrict all users to /fs ? dbc001 Slackware 12 07-28-2006 05:49 PM
chroot to restrict ssh directory access vbsaltydog Linux - Security 1 07-23-2006 05:28 PM
Restrict ssh/sftp with chroot? Chowroc Linux - Networking 4 01-25-2005 11:48 AM
How to restrict email from users... Supp0rtLinux Linux - Software 1 01-08-2003 04:37 AM


All times are GMT -5. The time now is 12:40 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration