Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums

Go Back   Code Forums > Systems > Linux / BSD / OS X

Reply
 
LinkBack Thread Tools Display Modes
Old 06-22-2002, 12:29 AM   #1 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,470
sde is on a distinguished road
jail/ chroot / whatever it's called.. how do i?

i want to allow a user to access my linux debian box.

i don't want them to be able to see my entire directory .. only the directory i specify as theirs. .. kinda like how web hosts do it.

the will need ftp and ssh access .. how can i lock them to their one directory, and not let them view anything above their home?


any ideas?
sde is offline   Reply With Quote
Old 06-22-2002, 02:15 AM   #2 (permalink)
redhead
Newbie
 
redhead's Avatar
 
Join Date: Jun 2002
Location: Denmark
Posts: 1,695
redhead is on a distinguished road
You could use any of the restricted shells..
r*sh, rbash is bash in restricted mode, rsh is sh in restricted mode.
http://www.lns.cornell.edu/public/CO...f_7.html#SEC77
As default BSD will trap users in a restricted mode, if their shell is beginning with a 'r'
__________________
Don't worry Ma'am, We're university students, We know what We're doing.
-----
If you pull the pin, Mr.Grenade would no longer be your friend.
-----
01000111 01101111 00100000 01000011 00100000 00100001
redhead is offline   Reply With Quote
Old 06-22-2002, 08:23 AM   #3 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,470
sde is on a distinguished road
thanks a lot redhead. that's the first time i've had that type of control over a user's login.. but i need to do something a little different.

that restricted the user to only their home directory. so even if they create a subdirectory themselves, they can not use the "cd" command to get in it.

also, for some reason, ftp would not work for that user when i restricted them.

i'm need to read more here.
sde is offline   Reply With Quote
Old 06-22-2002, 01:51 PM   #4 (permalink)
redhead
Newbie
 
redhead's Avatar
 
Join Date: Jun 2002
Location: Denmark
Posts: 1,695
redhead is on a distinguished road
Quote:
Originally posted by mmilano

that restricted the user to only their home directory. so even if they create a subdirectory themselves, they can not use the "cd" command to get in it.
Hmm... never tried anything that restricted.. Only the 'cd ..' restriction..

Quote:
Originally posted by mmilano
also, for some reason, ftp would not work for that user when i restricted them.

i'm need to read more here.
The reason why ftp wont accept login into a restricted shell, is because it's not listed in /etc/shells, put the r*sh you're using in there aswell, and ftp has access to it.
__________________
Don't worry Ma'am, We're university students, We know what We're doing.
-----
If you pull the pin, Mr.Grenade would no longer be your friend.
-----
01000111 01101111 00100000 01000011 00100000 00100001
redhead is offline   Reply With Quote
Old 06-22-2002, 04:23 PM   #5 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,470
sde is on a distinguished road
Quote:
Originally posted by redhead
Hmm... never tried anything that restricted.. Only the 'cd ..' restriction..
i don't want it to restrict 'cd' , but it is restricting that command for some reason. =/
sde is offline   Reply With Quote
Old 06-22-2002, 04:46 PM   #6 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,470
sde is on a distinguished road
ok, i found a patch, but how do i install it?

here is a link that says something about it ..
http://bugs.debian.org/cgi-bin/bugre...no\&bug=139047

and here is a link to the patch:
http://www.cag.lcs.mit.edu/~raoul/op...1-chroot.patch

but what the heck do i do with the patch?
sde is offline   Reply With Quote
Old 06-22-2002, 11:44 PM   #7 (permalink)
redhead
Newbie
 
redhead's Avatar
 
Join Date: Jun 2002
Location: Denmark
Posts: 1,695
redhead is on a distinguished road
Quote:
Originally posted by mmilano
ok, i found a patch, but how do i install it?
here is a link to the patch:
http://www.cag.lcs.mit.edu/~raoul/op...1-chroot.patch

but what the heck do i do with the patch?
Download it, get the source for your openssh, untar/gz it, enter the openssh-3.1p1 dir that emerges and issue the command:
patch -p1 < /the/downloadet/openssh-3.1p1-chroot.patch

Make sure, its the openssh-3.1p1 version you use it on, since theres allready a 3.3p1 version, but this patch was orriginaly made to 3.1p1.
Then just use your regular:
./configure --with-chroot && make && make install

Restart your sshd, and you can now use chrooted $HOME via ssh.
__________________
Don't worry Ma'am, We're university students, We know what We're doing.
-----
If you pull the pin, Mr.Grenade would no longer be your friend.
-----
01000111 01101111 00100000 01000011 00100000 00100001
redhead is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
jail ssh to users home directory? sde Linux / BSD / OS X 5 01-10-2004 10:09 AM
Reliance on Microsoft products called 'risk to US national security' bdl Code Newbie News 1 10-06-2003 10:09 AM


All times are GMT -8. The time now is 08:05 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting