LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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-02-2005, 04:44 PM   #1
whitetiger0990
LQ Newbie
 
Registered: Nov 2004
Location: There
Distribution: Ubuntu
Posts: 9

Rep: Reputation: 0
SSHD - keeping users in their own directory


I am wondering how to retrict SHH users to their own directory. Let's say I have Fred and his directory is /var/www/htdocs/fred. He can ftp in and he can ssh in. Both start in his directory and he owns the directory but with SSH he can cd / and see system files. He can even open them up in an editor but he can't save the changes. I'd like it if he couldn't even see them. Thanks
 
Old 01-02-2005, 04:50 PM   #2
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
The keyword is chroot

When doing this though, you'll possibly need to create a /bin type directory with some common commands they'll need to use and such...
 
Old 01-02-2005, 05:17 PM   #3
whitetiger0990
LQ Newbie
 
Registered: Nov 2004
Location: There
Distribution: Ubuntu
Posts: 9

Original Poster
Rep: Reputation: 0
I made a directory called /var/users/default and tried to chroot to it. but it said:

Code:
#chroot /var/users/default
chroot: cannot run command `/bin/bash': No such file or directory
 
Old 01-02-2005, 05:50 PM   #4
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
There needs to be a shell to run in the chroot directory unless you specify some other command. See man chroot for more details. Properly setting up a chroot jail can be tricky -- there are some tools that help with this, so you should google around for more info.
 
  


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
HowTo sshd deny all users except for one? mattengland Linux - Security 28 11-04-2007 02:53 PM
Re-installation while keeping users? jme Linux - General 1 02-06-2005 07:35 AM
chroot or keeping users to /home techrolla Linux - Security 9 06-22-2004 05:18 AM
sshd blocks users from other machines TommyB Linux - Networking 3 05-18-2004 01:19 PM
keeping the directory structure with mkisofs bignester Linux - Software 1 06-29-2003 12:11 PM

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

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