[CentOS] Trouble removing files in chrooted sftp

Wed Jan 11 20:23:00 UTC 2017
Clint Dilks <clintd at scms.waikato.ac.nz>

Hi

On Thu, Jan 12, 2017 at 12:07 AM, Myyrä, Timo <timo.myyra at edita.fi> wrote:

> I just did a bit of testing on OpenBSD and there the above setup seems to
> work and I can remove the files just fine over sftp.
> So this thing should work but there's still something causing it to fail on
> CentOS's side.
>


Just as a question is SELinux enabled ?

]# getenforce
Enforcing


I would assume so.  As a test you could try turning this off and see if
your problem goes away.

setenforce 0

If SELinux is the issue then I strongly advice that you use existing
SELinux Booleans or create your own local policy rather than turning
SELinux off, or leaving your system in permissive mode.


# getsebool -a | grep chroot

ssh_chroot_full_access --> off
ssh_chroot_manage_apache_content --> off
ssh_chroot_rw_homedirs --> off

https://wiki.centos.org/HowTos/SELinux may also help.

If it is SELinux related I would also look at installing setroubleshoot and
setroubleshoot-server.

I hope this helps :)