You are not logged in.

#1 2014-06-03 20:42:53

193
Member
Registered: 2014-05-16
Posts: 4

SFTP_chroot - does not work

What I want:
  User "lisa" should have access to her home-dir via sftp (and only to her home-dir!).

What I did:
  Follow https://wiki.archlinux.org/index.php/SFTP_chroot:
   * create user "lisa" with "/sbin/nologin"-shell, member of "sftponly"-group
   * changed sshd_config (see codepad)
   * set permissions: (2 versions: one for /home/lisa, one for a group sftponly with home-dir's inside)

     $ ls -l /
     drwxr-xr-x  5 root root  4096  3. Jun 21:07 home
     $ ls -l /home/
     drwxr-xr-x  2 root   root   4096  3. Jun 20:40 lisa
     drwxr-xr-x  3 root   root   4096  3. Jun 21:07 sftpusers
     $ ls -l /home/sftpusers/
     drwxr-xr-x 3 root root 4096  3. Jun 21:08 home
     $ ls -l /home/sftpusers/home/
     drwxr-xr-x 2 lisa sftponly 4096  3. Jun 21:08 lisa

Problem:
  * $sftp lisa@localhost
     produces (in any case) the following error:
     "Write failed: Broken pipe
      Couldn't read packet: Connection reset by peer"
  * so i checked the log (see 2nd codepad)
     I expected something like bad permissions... but nothing

Any ideas why this doesn't work?
It works if I remove the ChrootDirectory line in the sshd_config - but this
will result in access to any other folder, too - we don't want that! smile

Last edited by 193 (2014-06-03 21:06:11)

Offline

#2 2014-06-19 03:08:20

Minsc
Member
Registered: 2012-07-16
Posts: 95

Re: SFTP_chroot - does not work

Can you post sshd_config.

Edit: It's probably NOT client side. It's a chroot environment (which I had totally misread.) So this has to be a server side misconfiguration. Sorry, it's late smile

Last edited by Minsc (2014-06-19 03:14:28)

Offline

#3 2014-06-19 03:21:57

Minsc
Member
Registered: 2012-07-16
Posts: 95

Re: SFTP_chroot - does not work

Please run ssh --vvv lisa@localhost and paste the output. I've been running through your config --- looks fine. Now it's bugging me!

Offline

Board footer

Powered by FluxBB