SFTP Jail With Sun SSH Not OpenSSH

Hi all,

I have a Solaris 10 server with SUN_SSH_1.1 installed.

I want to restrict a user via SFTP to only be able to access one directory. I've written a little script in .profile which works perfectly for an ssh login but it appears sftp doesn't read the .profile file so it doesn't work.

I've read that you can use chroot with openSSH to achieve this, is it possible to do something similar with Sun_SSH_1.1?

Thanks in advance!

That's because SFTP is a subsystem of SSH and not a login shell.

Starting on version 4.8p1 of OpenSSH you can use the "Match" conditional block along with the "ChrootDirectory" option.

BTW, chroot support was implemented in OpenSolaris but unfortunately it never saw the light in Solaris and as far as I know there are no plans to ever port it. (see this blog entry)

Your options:

-Replace SunSSH with OpenSSH
-Create and configure the chroot by hand

Have a look at this document -> Setup of a chroot'd SFTP only server .

Also look at MySecureShell - Index , I used it with Winscp and it was relatively painless.