My ssh-server has been working like a charm for 4 years now, so I just want to add a user + chroot him to a specific folder.
> useradd -m -c /home/thomas -s /bin/sh thomas > passwd thomas > chmod 755 /home/thomas > chown root: /home/thomas > service ssh restart
When I do this, I can connect through
ssh and my
sftp connexion works. The problem is that I want to chroot to a specific folder.
> vim /etc/ssh/sshd_config
Add at the end of the file:
Match user thomas ChrootDirectory /home/%u
When I only add this, this shouldn't change something right? The configuration should be the same and I still should be able to connect or use sftp... so I restart with
service ssh restart and I cant connect with sftp anymore.
Just in case:
root@xx:/etc/nginx/sites-enabled# /usr/sbin/sshd -v sshd: illegal option -- v OpenSSH_6.0p1 Debian-4+deb7u6, OpenSSL 1.0.1t 3 May 2016 usage: sshd [-46DdeiqTt] [-b bits] [-C connection_spec] [-c host_cert_file] [-f config_file] [-g login_grace_time] [-h host_key_file] [-k key_gen_time] [-o option] [-p port] [-u len] root@xx:/etc/nginx/sites-enabled#
What am I doing wrong?