Prevent deleting files in particular directory
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
Recently, I deleted some files accidentally. Fortunately, I was able to recover them. That is why I would like to prevent deleting files in a particular directory but still allow to create new files and modify them. So, permissions should be rwx, but if I want to delete ANY file (created by ANY user) in this directory, I should be prompted to input a password. Is this possible somehow on Debian Testing?
permissions password root chmod chown
add a comment |Â
up vote
0
down vote
favorite
Recently, I deleted some files accidentally. Fortunately, I was able to recover them. That is why I would like to prevent deleting files in a particular directory but still allow to create new files and modify them. So, permissions should be rwx, but if I want to delete ANY file (created by ANY user) in this directory, I should be prompted to input a password. Is this possible somehow on Debian Testing?
permissions password root chmod chown
similar question on AU How can I set up a password for the 'rm' command?, by the way you want password protectfind -delete
ormv * afile
or any other scripting way?
â Ã±ÃÂsýù÷
Oct 2 '17 at 17:03
I am just reading the thread you mentioned. I want to protect just the normalrm afile
which I can do through the file manager. It does not have to be secure, but just prevent me from making mistakes.
â tavkomann
Oct 2 '17 at 17:10
This seems to be what I want: askubuntu.com/a/866003/692458 Is it possible to change the rm executable only in a specific directory and not everywhere?
â tavkomann
Oct 2 '17 at 17:19
see also How to prevent users from deleting a directory?.
â Ã±ÃÂsýù÷
Oct 2 '17 at 17:27
Maybe directory protection would suffice for me.chattr +a directory
also looks not bad. Is there something similar which allows me to rename and change the files?
â tavkomann
Oct 2 '17 at 18:03
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
Recently, I deleted some files accidentally. Fortunately, I was able to recover them. That is why I would like to prevent deleting files in a particular directory but still allow to create new files and modify them. So, permissions should be rwx, but if I want to delete ANY file (created by ANY user) in this directory, I should be prompted to input a password. Is this possible somehow on Debian Testing?
permissions password root chmod chown
Recently, I deleted some files accidentally. Fortunately, I was able to recover them. That is why I would like to prevent deleting files in a particular directory but still allow to create new files and modify them. So, permissions should be rwx, but if I want to delete ANY file (created by ANY user) in this directory, I should be prompted to input a password. Is this possible somehow on Debian Testing?
permissions password root chmod chown
permissions password root chmod chown
asked Oct 2 '17 at 17:00
tavkomann
1035
1035
similar question on AU How can I set up a password for the 'rm' command?, by the way you want password protectfind -delete
ormv * afile
or any other scripting way?
â Ã±ÃÂsýù÷
Oct 2 '17 at 17:03
I am just reading the thread you mentioned. I want to protect just the normalrm afile
which I can do through the file manager. It does not have to be secure, but just prevent me from making mistakes.
â tavkomann
Oct 2 '17 at 17:10
This seems to be what I want: askubuntu.com/a/866003/692458 Is it possible to change the rm executable only in a specific directory and not everywhere?
â tavkomann
Oct 2 '17 at 17:19
see also How to prevent users from deleting a directory?.
â Ã±ÃÂsýù÷
Oct 2 '17 at 17:27
Maybe directory protection would suffice for me.chattr +a directory
also looks not bad. Is there something similar which allows me to rename and change the files?
â tavkomann
Oct 2 '17 at 18:03
add a comment |Â
similar question on AU How can I set up a password for the 'rm' command?, by the way you want password protectfind -delete
ormv * afile
or any other scripting way?
â Ã±ÃÂsýù÷
Oct 2 '17 at 17:03
I am just reading the thread you mentioned. I want to protect just the normalrm afile
which I can do through the file manager. It does not have to be secure, but just prevent me from making mistakes.
â tavkomann
Oct 2 '17 at 17:10
This seems to be what I want: askubuntu.com/a/866003/692458 Is it possible to change the rm executable only in a specific directory and not everywhere?
â tavkomann
Oct 2 '17 at 17:19
see also How to prevent users from deleting a directory?.
â Ã±ÃÂsýù÷
Oct 2 '17 at 17:27
Maybe directory protection would suffice for me.chattr +a directory
also looks not bad. Is there something similar which allows me to rename and change the files?
â tavkomann
Oct 2 '17 at 18:03
similar question on AU How can I set up a password for the 'rm' command?, by the way you want password protect
find -delete
or mv * afile
or any other scripting way?â Ã±ÃÂsýù÷
Oct 2 '17 at 17:03
similar question on AU How can I set up a password for the 'rm' command?, by the way you want password protect
find -delete
or mv * afile
or any other scripting way?â Ã±ÃÂsýù÷
Oct 2 '17 at 17:03
I am just reading the thread you mentioned. I want to protect just the normal
rm afile
which I can do through the file manager. It does not have to be secure, but just prevent me from making mistakes.â tavkomann
Oct 2 '17 at 17:10
I am just reading the thread you mentioned. I want to protect just the normal
rm afile
which I can do through the file manager. It does not have to be secure, but just prevent me from making mistakes.â tavkomann
Oct 2 '17 at 17:10
This seems to be what I want: askubuntu.com/a/866003/692458 Is it possible to change the rm executable only in a specific directory and not everywhere?
â tavkomann
Oct 2 '17 at 17:19
This seems to be what I want: askubuntu.com/a/866003/692458 Is it possible to change the rm executable only in a specific directory and not everywhere?
â tavkomann
Oct 2 '17 at 17:19
see also How to prevent users from deleting a directory?.
â Ã±ÃÂsýù÷
Oct 2 '17 at 17:27
see also How to prevent users from deleting a directory?.
â Ã±ÃÂsýù÷
Oct 2 '17 at 17:27
Maybe directory protection would suffice for me.
chattr +a directory
also looks not bad. Is there something similar which allows me to rename and change the files?â tavkomann
Oct 2 '17 at 18:03
Maybe directory protection would suffice for me.
chattr +a directory
also looks not bad. Is there something similar which allows me to rename and change the files?â tavkomann
Oct 2 '17 at 18:03
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
1
down vote
You can do that with aufs
/ unionfs
. You put the files which are to be protected in the read-only level.
Real file deletion could be realized with password protection by having the read-only directory in
/path/to/ro
with ro
belonging to a special user and having 755 permissions. Deletions could be done with sudo
then:
sudo -u rmuser rm /path/to/ro/file
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
You can do that with aufs
/ unionfs
. You put the files which are to be protected in the read-only level.
Real file deletion could be realized with password protection by having the read-only directory in
/path/to/ro
with ro
belonging to a special user and having 755 permissions. Deletions could be done with sudo
then:
sudo -u rmuser rm /path/to/ro/file
add a comment |Â
up vote
1
down vote
You can do that with aufs
/ unionfs
. You put the files which are to be protected in the read-only level.
Real file deletion could be realized with password protection by having the read-only directory in
/path/to/ro
with ro
belonging to a special user and having 755 permissions. Deletions could be done with sudo
then:
sudo -u rmuser rm /path/to/ro/file
add a comment |Â
up vote
1
down vote
up vote
1
down vote
You can do that with aufs
/ unionfs
. You put the files which are to be protected in the read-only level.
Real file deletion could be realized with password protection by having the read-only directory in
/path/to/ro
with ro
belonging to a special user and having 755 permissions. Deletions could be done with sudo
then:
sudo -u rmuser rm /path/to/ro/file
You can do that with aufs
/ unionfs
. You put the files which are to be protected in the read-only level.
Real file deletion could be realized with password protection by having the read-only directory in
/path/to/ro
with ro
belonging to a special user and having 755 permissions. Deletions could be done with sudo
then:
sudo -u rmuser rm /path/to/ro/file
answered Oct 2 '17 at 20:25
Hauke Laging
53.7k1282130
53.7k1282130
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f395691%2fprevent-deleting-files-in-particular-directory%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
similar question on AU How can I set up a password for the 'rm' command?, by the way you want password protect
find -delete
ormv * afile
or any other scripting way?â Ã±ÃÂsýù÷
Oct 2 '17 at 17:03
I am just reading the thread you mentioned. I want to protect just the normal
rm afile
which I can do through the file manager. It does not have to be secure, but just prevent me from making mistakes.â tavkomann
Oct 2 '17 at 17:10
This seems to be what I want: askubuntu.com/a/866003/692458 Is it possible to change the rm executable only in a specific directory and not everywhere?
â tavkomann
Oct 2 '17 at 17:19
see also How to prevent users from deleting a directory?.
â Ã±ÃÂsýù÷
Oct 2 '17 at 17:27
Maybe directory protection would suffice for me.
chattr +a directory
also looks not bad. Is there something similar which allows me to rename and change the files?â tavkomann
Oct 2 '17 at 18:03