S
S
SKEPTIC2020-06-09 12:26:20
linux
SKEPTIC, 2020-06-09 12:26:20

How to protect a folder/file from being renamed in ubuntu 18.04?

How to protect a folder/file from being renamed in ubuntu 18.04?
chown to the web server, chmod 750, but for some reason an ftp user who does not own this folder can rename it.
It cannot download, open it, delete it, set the rights, but it can rename it.
What the heck?
The server sits on ubuntu 18.04, I use vsftpd as ftp

Answer the question

In order to leave comments, you need to log in

2 answer(s)
L
Lynn "Coffee Man", 2020-06-09
@pro100chel

The filename is not part of the file, but an entry in the parent folder.
So write-protect the parent folder.

A
Alexander Karabanov, 2020-06-09
@karabanov

chattr

[email protected]:/tmp$ mkdir test
[email protected]:/tmp$ sudo chattr +i test
[sudo] пароль для zend: 
[email protected]:/tmp$ mv test test1
mv: невозможно переместить 'test' в 'test1': Операция не позволена

With just files, the same theme. To remove the immutable bit, type chattr -i

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question