1

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.

2 Answers 2

1

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.

2

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .