CentOS SFTP chroot

خرید بک لینک

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 inteal-sftp
Match Group sftp-only
ChrootDirectory /home/sftp/%u
    AllowTCPForwarding no
    X11Forwarding no
    ForceCommand inteal-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 (?)

- - , .
.

Recent Questions...

ما را در سایت Recent Questions دنبال می‌کنید

برچسب: نویسنده: استخدام کار بازدید: 322 تاريخ: سه شنبه 22 تير 1395 ساعت: 22:26

صفحه بندی