Can't rename /public_html directory from FTP

Is it normal than a user connected by FTP couldn’t rename any root directories ?
He get this error :

Command :RNFR public_html
Answer :350 Ready for RNTO.
Command :RNTO public_html.ok
Answer :550 Rename failed.

All files/directories have the correct owner, even in the root directory.
Obviously, with SSH I can do what I want…

That is correct users should ben to be to change it…

But they can’t… here the rights for the root directories :

drwxr-x--x 2 J05 J05 4.0K Jul 19  2022 cgi-bin
drwxr-x--x 2 J05 J05 4.0K Aug 27 07:23 document_errors
dr-xr-x--x 2 J05 J05 4.0K Aug 27 07:23 logs
drwxr-x--x 3 J05 J05 4.0K Oct 19  2023 private
drwxr-x--x 8 J05 J05 4.0K Oct 22 00:04 public_html
drwxr-x--x 7 J05 J05 4.0K Oct 22 09:17 public_html.nok
drwxr-x--x 5 J05 J05 4.0K Oct 19  2023 public_html.v1
dr-xr-x--x 2 J05 J05 4.0K Jul 19  2022 stats

I tried to change it by FTP user connection and I still get the error…

On vsftpd.log I only have this :

Tue Oct 22 11:06:12 2024 [pid 83812] [J07_me] OK LOGIN: Client "88.139.xx.xx"
Tue Oct 22 11:06:12 2024 [pid 83814] [J07_me] FAIL RENAME: Client "88.139.xx.xx", "/public_html /public_html.old"

And even with SFTP, I can’t rename or create a new root directory :

Command :mkdir /home/J05/web/blog.domain.com/test
Error :mkdir /home/J05/web/blog.domain.com/test: permission denied

Yes, it is.

Default perms for dir /home/J05/web/yourdomain are 551 so no write perms for your user and if no write perms then you can’t rename any dir.

You can’t, at least no with your user J05.

Execute this and you will be able to rename it.

Note: keep in mind that users could break the conf and this change will affect to all the users.

v-change-sys-config-value DOMAINDIR_WRITABLE yes
v-rebuild-web-domains J05
1 Like

I just found the workaround to manually change rights to parent dir to 751, but I didn’t know the v-command with correct option.
So it was not a bug, but a secure feature !
Thanks for the tip :+1:

1 Like

Yes

Keep in mind that if you don’t change the directive DOMAINDIR_WRITABLE, the next update or next rebuild you will loose those perms.

1 Like

Thanks for the precision, it’s important !

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.