Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

I tried the following configuration in sshd_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 sshd. User can't login using the correct password. Connection refused authentication failed.

share|improve this question
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.

share|improve this answer

Check these logs:



Sometimes you get authentication failed because permissions weren't correct for the home/chrooted directory. Also, make sure you read the SFTP docs regarding permissions for the ChrootDirectory directive and the parent of it because SSH is picky about who has access to them.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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