Re: Defining root directory for sftp-server logins



On 14 May, 19:40, Marten Lehmann <lehmannmap...@xxxxxx> wrote:
Hello,

from proftpd I'm used to the option "DefaultRoot" which I can set to
"~". That way, a used cannot escape his home directory (e.g. get a
listing of all users in /home). Of course the permissions are set
correctly on our servers, so user u1234 cannot get files of the user
u4321. But we like to have a situation, where user u1234 just sees the
directory "/" which is in fact /home/u1234, but for him, it is the root
directory of the sftp session.

How can I do this with sftp-server?

This is non--trivial. You need to implement chroot cages, and they're
deliberately *not* in the OpenSSH code base despite years of people
asking for it and numerous authors or publishers of tools to do it
(including me). This is not the chroot listed in OpenSSH's sshd_config
file! That's an entirely separate bit of ssh daemon behavior, which
while exciting for security reasons had nothing to do with user chroot
cages, and frankly destablizied a lot of setups before it matured.

Frankly, if all you want is upload and download space instead of shell
access, pursue WebDAV over HTTPS, which has all that functionality
built-in, runs on standard Apache, is vastly more configurable, and is
supported by Windows Network Neighborhood automatically without having
to install anything. It's also supported by various Java GUI's,
Konqueror, and lftp for the Linux and UNIX world or MacOS.

.



Relevant Pages

  • Re: Giving limited access to remote FTP user via vsftpd
    ... I always chroot the user. ... chroot the user, then create symblink in the users home directory, to ... but is a wonderful feature if you use it right. ... get a custom view of FTP that can follow any path I let them into. ...
    (Fedora)
  • RE: CGI security on a shared web server
    ... Onderwerp: Re: CGI security on a shared web server ... You can also add chrooting the user into their home directory and the ... You also have to be careful with what you place within the chroot() environment ... to make sure that the user can't gain root privs as its relatively simple to ...
    (SecProg)
  • Re: OpenSSH CHROOT newbie
    ... >solution to keep users within a home directory. ... >Chroot plugin for SSH, but for the life of me I cannot figure out how to ... You then need to install a chroot cage in the "/./" ...
    (comp.security.ssh)
  • [openSSH] home dir shared between users
    ... I have a host which allows sftp/scp access via user ... All users share one common home directory. ... the username of a different user to login as the users all share ... create a separate home dir in the chroot for every user and do a bind mount ...
    (comp.security.ssh)