
whit at transpect
May 17, 2012, 10:08 AM
Post #8 of 9
(751 views)
Permalink
|
|
Re: Is there any method, with ChrootDirectory and internal-sftp, to automatically cd to a subdir on login?
[In reply to]
|
|
On Thu, May 17, 2012 at 12:29:26AM +0200, ngel Gonzlez wrote: > On 16/05/12 23:27, Peter Stuge wrote: > > ngel Gonzlez wrote: > >> Peter Stuge wrote: > >>> set the home directory to /files for the relevant users > >> If the user folder is /home/username, just change the > >> ChrootDirectory to /home/%u, and then make their home > >> /home/user1/files > > As I wrote, the home directory should be /files in that case. ... > Right. Sorry for the confusion. Their home directory should be /files, > which would map to /home/user1/files, but you set it to /files Thanks for the clarifying advice. I hadn't realized that the home directory cd'd to is relative to the chroot. I still can't see how to get this to suffice in my setup though. For one thing it's not a single directory branch. There are users at /path/one/userXdir and /path/two/userYdir Also userXdir != userid so /home/%u does not capture the layout. I need some way to work from the home dir as given in /etc/passwd, so that it would chroot to that and then cd to /path/one/userXdir/files The problem with the OpenSSH approach described so far is that there's no apparent way to specify the chrootdir for systems with more complicated layouts than can be expressed in a formula like /home/%u. Or can it? Whatever the weakness of scponly's design, the specification of a home dir takes the form of /path/one/userXdir//files resulting in a chroot to /path/one/userXdir/ and a cd to /files. So it handles a situation where there's both a /path/one and a /path/two fine, and where the userXdir != uid. It would still be good to find a way to get equivalent functionality using the OpenSSH internal sftp without scponly, but from my clearer understanding now, it looks like there's no way. Thanks again, Whit _______________________________________________ openssh-unix-dev mailing list openssh-unix-dev [at] mindrot https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev
|