1

I'm trying to create an FTP user that would have only access to a particular dir (/var/ftp/themeeditor). Most of the setup seems to work except that sshd complains about the ownership of the directory with the following error:

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

However, as far as I understand the directories have the right ownership, they are owned by root and are not world-writable:

bitnami@xxx:/var/ftp$ ls -ld /var
drwxr-xr-x 13 root root 4096 Aug  8 09:31 /var
bitnami@xxx:/var/ftp$ ls -ld /var/ftp/
drwxrwxr-x 3 root root 4096 Aug  8 09:31 /var/ftp/
bitnami@xxx:/var/ftp$ ls -ld /var/ftp/themeeditor/
drwxr-xr-x 13 root root 4096 Aug  8 09:33 /var/ftp/themeeditor/ 

Any idea what could be the issue?

laurent
  • 179
  • 3
  • 12
  • Possible duplicate of [fatal: bad ownership or modes for chroot directory component "/" in SFTP](http://serverfault.com/questions/730305/fatal-bad-ownership-or-modes-for-chroot-directory-component-in-sftp) ... note the **not writable by any other user or group** – Jakuje Aug 08 '16 at 13:17
  • @Jakuje, I've read this post before, but it doesn't quite answer my question. In particular the permissions I've set follow the condition "must be root-owned directories that are not writable by any other user or group.", yet I still get an ownership error. Any chance the question could be reopened? – laurent Aug 08 '16 at 14:00
  • 1
    Your `/var/ftp/` have `w` permissions for a group (it does not matter that the group is `root`). Remove that bit and it will work for you. – Jakuje Aug 08 '16 at 14:02

1 Answers1

1

Your /var/ftp/ have w permissions for a group (it does not matter that the group is root). Remove that bit and it will work for you.

Jakuje
  • 9,715
  • 2
  • 42
  • 45