Goal: to limit user access to home directory and symlinked directories in home.

I tried the following conigurgation is shhd_config

# Subsystem sftp /usr/lib/openssh/sftp-server
Subsystem sftp internal-sftp

Match user matt
     ChrootDirectory %h
     X11Forwarding no
     AllowTcpForwarding no
     ForceCommand internal-sftp

and then restarted ssh. user con't login using correct password. connection refused authentication failed.

link|improve this question
feedback

2 Answers

up vote -1 down vote accepted

With chroot SFTP, the home directory of the user must be owned by root:root and not be writable by the user.

Edit to add: The symlinks you mention will only work if they are relative symlinks to targets within the home directory.

link|improve this answer
feedback

Check /var/log/messages.

Sometimes you get authentication failed because permissions weren't correct for the directory. Make sure you read the SFTP docs regarding permissions for the ChrootDirectory and the parent.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.