Questions tagged [chattr]

chattr is a Linux command-line tool to change file attributes on a Linux ext2/3/4 file system, e.g. to make files immutable or append-only even for the root user.

chattr is a Linux command-line tool to change file attributes on a Linux ext2/3/4 file system, e.g. to make files immutable or append-only even for the root user.

chattr is part of the e2fsprogs package and is available from http://e2fsprogs.sourceforge.net/.

8 questions
15
votes
1 answer

Linux: How can I view a file's attributes which I set using `chattr`?

I have a file, which I wanted to protect from accidental deletion, so I've ran: chattr +i filename Now my question is, once I've changed a file attributes, where can I see the newly set attributes?
Itai Ganot
  • 10,424
  • 27
  • 88
  • 143
5
votes
3 answers

Can I simulate an S3 bucket going down when it is accessible to root user?

I'm trying to test new network monitoring code for an application that runs on a Debian appliance. I am currently tasked with ensuring that an SNMP trap is thrown when external network shares (such as S3 buckets) are mounted with FUSE and the…
jajavoli
  • 53
  • 3
2
votes
1 answer

Prevent deletion of folder but let access to everything inside of it

I know there is the +i flag for files and directories, but i have a deeper Problem. Is there a way to prevent a folder from being deleted by an User which should be able to create / access / remove files and folders INSIDE the delete-protected…
fechnert
  • 133
  • 9
0
votes
1 answer

Why does `chattr +e ` fail with no space left on the device when there's plenty?

I have a problem. chattr +e does not work, if the file does not have the +e attr set on it, or if it's removed and re-added. [root@ip-203-0-113-13 log]# df -Th Filesystem Type Size Used Avail Use% Mounted on devtmpfs devtmpfs …
Wayne Werner
  • 709
  • 4
  • 14
  • 26
0
votes
3 answers

Why dir contents get deleted with chattr +a?

On an ext4 filesystem, I have a base dir which itself has three dirs a, b and c, and each dir has various contents inside. I set chattr +a base and then executed rm -r base. Then I found a, b, c were still there. Nice. Then I found they all became…
Cyker
  • 205
  • 2
  • 10
0
votes
2 answers

Stop file being deleted on NFS mount

I have files stored on an NFS mount which I want to prevent being deleted. The use case is I have a demo version of a web application which uses the same images on every demo - when someone deletes a record it deletes the associated images, files…
bhttoan
  • 620
  • 3
  • 15
  • 26
0
votes
0 answers

Permission denied after chattr use

tried chattr on a file but can't revert it's effect. currently it looks like lsattr /path/myfile --------------e----- /path/myfile ls -la /path/myfile -rwxr-xr-x 1 root root 0 Jul 5 11:12 /pat/myfile still sudo echo "text" > /path/myfile -bash:…
-1
votes
1 answer

Why is 'chattr' on CentOS 6 returning 'Killed'?

Why is 'chattr' on CentOS 6 returning 'Killed'? # chattr -i /usr/sbin Killed # file /usr/bin/chattr /usr/bin/chattr: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linker (uses shared libs), for GNU/Linux 2.6.9, not # uname…