2
I've some issues chrooting an SFTP access for a client.
I can access the directory, but the problem is I can't read / write, I can just access the directory.
Below is what I've done :
# cat /etc/passwd | grep comege
comege:x:1001:1001::/home/sftp/comege/home/:/sbin/nologin
# cat /etc/group | grep sftp
sftp-only:x:1001:
# sshd_config
Subsystem sftp internal-sftp
Match Group sftp-only
ChrootDirectory /home/sftp/%u
AllowTCPForwarding no
X11Forwarding no
ForceCommand internal-sftp
SELinux is set on permissive for testing purposes.
When I connect to the server using SFTP I get the following error :
Error listing directory '/'. Permission denied
Permissions :
/home/sftp/comege and parent directories belongs to root:root.
/home/sftp/comege/home belongs to comege:sftp-only
I think the issue is comege isn't redirected to /home/sftp/comege/home on connection, so it gets to /home/sftp/comege which belongs to root hence the lack of permissions (?)