Share your knowledge at the LQ Wiki.
Go Back > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Solaris / OpenSolaris This forum is for the discussion of Solaris, OpenSolaris, OpenIndiana, and illumos.
General Sun, SunOS and Sparc related questions also go here. Any Solaris fork or distribution is welcome.


  Search this Thread
Old 12-11-2008, 04:49 AM   #1
LQ Newbie
Registered: Dec 2008
Posts: 1

Rep: Reputation: 0
Chroot jail for sftp, Solaris 10, OpenSSH_5.1p1

The system is Solaris 10 with OpenSSH_5.1p1

I tried a few different ways to chroot a user, but the user can still browse around.
The user created: guests:guests
The entry in passwd:

done ftpconfig -d /dir/guests
created /etc/shells and /bin/true added
/etc/ftpd/ftpaccess modified to include:
guestuser guests
upload /dir/guests/pub * no
upload /dir/guests/pub /pub yes guests guests 0666 nodirs
upload /dir/guests/pub /pub yes guests guests 0666 nodirs

In this way the user guests can still browse the directories and is not jailed to his dir. When I replaced the shell to /bin/true, the sftp closes straight after authentication with exit status 0. I also tried /usr/bin/true (was added to /etc/shells), but exit status 0 again.

The other way I tried:
added to the /etc/ssh/sshd_config
Subsystem sftp /usr/lib/ssh/sftp-server
Match Group guests
ChrootDirectory /dir/guests
ForceCommand /usr/lib/ssh/sftp-server
AllowTcpForwarding no

Then restarted the ssh, but ssh went into maintenance and reported Bad configuration option Match, the same for ChrootDirectory and ForceCommand.
I thought Match was valid for OpenSSH_5.

I have ran out of options. I would really appreciate any help and comments. Thanks a lot.
Old 12-14-2008, 09:31 PM   #2
Registered: Apr 2008
Posts: 310

Rep: Reputation: 30
Hey Saskak,

That's a big issue with Sol 10 (At least, it seems as though it all used to be so much easier

Rather than going the full-chroot avenue (where you have to copy all the relevant binary and libraries into the chrooted environment - so your user can do "ls", etc), check out this page. I've found it to be very helpful:

Best of luck to you!

, Mike


openssh, sftp, solaris

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
Chroot jail Gimpy Linux - Software 10 05-07-2010 01:30 PM
Chroot and sftp on Solaris 10 omlex Solaris / OpenSolaris 2 07-15-2008 09:48 PM
sftp chroot jail, not able to find lib files drolic Linux - Security 3 11-23-2005 11:57 AM
Jail and chroot rogk Linux - Security 2 10-16-2005 02:20 AM
chroot jail sftp users f1uke Linux - Security 1 07-28-2003 10:29 AM > Forums > Other *NIX Forums > Solaris / OpenSolaris

All times are GMT -5. The time now is 02:24 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration