0

Trying to follow this tutorial but for Arch Linux.

/etc/ssh/sshd_config:

# override default of no subsystems
#Subsystem      sftp    /usr/lib/ssh/sftp-server
Subsystem       sftp    internal-sftp

Match Group filetransfer
        ChrootDirectory %h
        X11Forwarding no
        AllowTcpForwarding no
        ForceCommand internal-sftp

/srv/www/vhostname:

drwxr-xr-x  6 root           root           4096 Apr 23 19:17 .
drwxrwxr-x 25 root           root           4096 Apr 23 18:43 ..
drwxr-xr-x  7 user           filetransfer   4096 Apr 23 19:25 public

$ grep user /etc/passwd:

user:x:1234:1234::/srv/www/vhostname:/bin/false`

$ groups user

filetransfer user

When connecting from FileZilla, I get this:

Error: Authentication failed. Error: Critical error: Could not connect to server

For some reason I can log in successfully if I change the user's home directory to /. Some guides say the home directory will be changed to relative to the chroot. But it gets treated absolutely and takes me to the root filesystem directory, which is of course the exact opposite of what I want.

I can also log in successfully if I comment out the chroot line in sshd_config, but that doesn't help.

  • What are the permissions on /srv? – Andrew Henle Apr 25 '15 at 21:42
  • drwxr-xr-x 5 root root – Hugh Guiney Apr 26 '15 at 23:47
  • Well, put your sshd under strace and see what it does: strace -f -o /tmp/strace.out -p PID, where PID is the process ID of the sshd process. Then try your FileZilla connection, kill the strace, and look in the strace output and see what sshd actually did. – Andrew Henle Apr 27 '15 at 1:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.