Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

2 Answers 2

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:

/var/log/messages

/var/log/secure

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

 
discard

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.