LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 09-06-2008, 07:35 AM   #1
/dev/me
Member
 
Registered: May 2008
Distribution: Slackware 13
Posts: 116

Rep: Reputation: 20
chroot certain SSH users


Hi,

Just a quick question. Is it possible to chroot certain SSH-users but not others?


I have found that I can easily chroot /all/ ssh users. But I would lock myself out in that way O_o and I only want to lock out certain users from all except their ~/

Looking for this I found several howto's describing mainly Debian based setups. It talked about patching ssh, using a different version of ssh (other than openSSH that is) or adding another authentication layer. But I was thinking maybe someone here knows something more 'slacky'*) for this purpose?
These users I want to chroot in SSH are also FTP-users and in that protocol it was very easy to chroot a list of users. I was kind of searching for something similar in SSH, but alas. I may be looking in the wrong places though. Sometimes you just don't see something because you expected something else.


So I'm hoping for something like this:
sshd_config
Code:
enable_overlooked_options=YES
chroot_list_of_users=/path/to/list_of_users

*) Slacky meaning, it Just Works once you've found the proper config option.
 
Old 09-06-2008, 08:00 AM   #2
santaslilslacker
Member
 
Registered: Nov 2007
Distribution: Slackware64_current
Posts: 45

Rep: Reputation: 27
Hi,
Try with this script. It requires some minimum tweaking but it's rather easy to use.
http://www.fuschlberger.net/programs...p-chroot-jail/
Regards,


S.
 
Old 09-06-2008, 08:44 AM   #3
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
Or maybe run 2 sshd daemon, with one that uses another port than TCP/UDP 22 and another configuration file with the -f option, so you end with 2 configs, one for your user and another one for all other users
 
Old 09-08-2008, 12:13 PM   #4
/dev/me
Member
 
Registered: May 2008
Distribution: Slackware 13
Posts: 116

Original Poster
Rep: Reputation: 20
Thanks for your input santaslilslacker and keefaz!

But I don't really like both options. So I've decided that I let it, until I find something that does this a little cleaner. A chrooted user environment is a nasty business in any case, needing all sorts of extra steps. Rather than troubling myself with that, I reviewed my permission system and don't see how they can cause any trouble in a normal environment.

I don't really like the idea that other people can read my passwd file or init scripts, but so be it. It's a limited list of users who's names and addresses are known by yours truly.

I solved everything with this:

echo 'echo -e "I know where your house lives. I know where your bed sleeps.\nYou are being watched!"' >> /home/$user/.bashrc
 
Old 09-08-2008, 12:33 PM   #5
rworkman
Slackware Contributor
 
Registered: Oct 2004
Location: Tuscaloosa, Alabama (USA)
Distribution: Slackware
Posts: 2,559

Rep: Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351
In newer (>=4.9 iirc) openssh, you can do this quite easily with the Match directive.
You will have to create a basic directory structure (most easily accomplished by installing all of the A package series into an alternate root).
Also, the chrooted user accounts must exist both on the real system and inside the chroot.
 
Old 09-08-2008, 01:05 PM   #6
/dev/me
Member
 
Registered: May 2008
Distribution: Slackware 13
Posts: 116

Original Poster
Rep: Reputation: 20
Quote:
Originally Posted by rworkman
In newer (>=4.9 iirc) openssh, you can do this quite easily with the Match directive.
You will have to create a basic directory structure (most easily accomplished by installing all of the A package series into an alternate root).
Also, the chrooted user accounts must exist both on the real system and inside the chroot.
Ah yes, silly me. I am running Slackware 12.0 on the server with ssh v. 4.6(p1) and hadn't thought it be a factor.

But *looks hopeful* I may be getting my new machine tomorrow and I intend to install Slack 12.1 on that. That *bling* new machine is going to be the definitive answer to computing, the future and everything...

I'll look into that once I migrated.
 
  


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
List chroot users zzyzx Linux - Server 2 08-19-2008 10:49 AM
vsftpd chroot for users bfay Linux - Software 0 07-21-2006 09:13 AM
ssh for chroot Thorsten Linux - Security 1 08-26-2003 05:46 AM
ssh for chroot Thorsten Linux - Software 0 08-26-2003 03:49 AM
Chroot users thecrab Linux - Security 6 03-03-2002 05:21 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 04:34 AM.

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