0

I ran sudo chrgp somegroup ./

then: sudo chmod g+rwx ./

As I was trying to fix another issue; however suddenly all users cannot SFTP using WinSCP/Fillzella to thier own directores where they have full access 777.

How can I reverse the above commands? my guess is that I changed some other folders rights, esp. with chmod, which affected the SFTP functionality.

When checking /var/log/auth.log it shows:

fatal: bad ownership or modes for chroot directory component "/"

Thank you very much!

Edit: Sloved: write permission should be removed God knows why --> 755: https://serverfault.com/questions/418931/sftp-fatal-bad-ownership-or-modes-for-chroot-directory-ubuntu-12-04

1 Answers1

0

This is a chroot problem.

ALL SFTP chroots (OpenSSH's included SFTP tooling as well!) MUST be owned by root to properly work. This is a limitation of the libraries, but also because the chroot command that is called here for use uses root. Therefore, wherever you ran the sudo chgrp call and then the sudo chmod calls needs to be undone and the chroot be permitted to be owned as root.

Undo whatever changes you did and it should work again. I strongly suggest you read this post on Unix and Linux which gives slightly better insights as to why this is the case.

Thomas Ward
  • 78,878