You are not logged in.

#1 2023-04-01 10:38:08

Relwi
Member
Registered: 2022-07-26
Posts: 2

Can't get SFTP chroot work

Hi, I'm trying to follow this guide https://wiki.archlinux.org/title/SFTP_chroot, but when I'm going to connect it doesn't work, it says `authentication failed` (I'm using termscp). I have followed this steps (all with root user):

1. Comprobate that I have `Subsystem sftp /usr/lib/ssh/sftp-server` in `/etc/ssh/sshd_config`
2. Create a directory in `/var/lib/sftp-jail` with root:root owner and 755 permission
3. Create a sftpuser user with `useradd -s /usr/bin/nologin -d /var/lib/sftp-jail sftpuser` and set a password to the user
4. Configure OpenSSH, but using `Match User` instead `Match Group`
5. Fixing path for authorized keys, but putting `/etc/ssh/authorized_keys` instead `/etc/ssh/authorized_keys/%u`, then I copied the content of the client `ssh-ed25519` key into it
6. Restart `sshd.service`

I have the `AuthenticationMethods publickey` in the config

Offline

#2 2023-04-01 12:22:32

schard
Forum Moderator
From: Hannover
Registered: 2016-05-06
Posts: 2,611
Website

Re: Can't get SFTP chroot work

Please show the actual entire sshd_config as well as the user's passwd entry and the stat of the chroot directory.


Inofficial first vice president of the Rust Evangelism Strike Force

Offline

Board footer

Powered by FluxBB