Questions tagged [xattr]

Extended attributes (commonly called "xattrs") are a way to associate metadata with files/directories in the filesystem.

Filter by
Sorted by
Tagged with
0 votes
1 answer
34 views

Find all the folders that are concealed using 'chflags'

I have concealed some folders on my laptop using chflags: chflags hidden hide-me And I don't remember where exaclty these folders are located. How is it possible to find all of them? (Probably by ...
jsx97's user avatar
  • 107
0 votes
0 answers
48 views

Who sets the dot permission in ls -l output at build time in linux?

We have a custom build of Linux and user-land applications which contains libselinux, attr, OpenSSH, systemd, docker-ce and few more applications. We have a rpm based build system similar to fedora. ...
Prajval Badiger's user avatar
1 vote
1 answer
56 views

Can't remove ceph xattrs on linux

I had set xattrs for quota limits on CephFS $ setfattr -n ceph.quota.max_bytes -v 1100000000 /mnt/cephfs/data/ I can get value of this attribute $ getfattr -n ceph.quota.max_bytes /mnt/cephfs/data/ ...
Dan B's user avatar
  • 11
0 votes
0 answers
63 views

ntfs-3g - getfattr shows only user namespace

I have mounted my NTFS-HDD to Alpine Linux with the following mount options in fstab UUID=4038A92D38A92340 /1TB ntfs defaults,nofail,utf8 0 0 when I use getfattr -d --match="-" myfile I don'...
Ben's user avatar
  • 299
0 votes
1 answer
125 views

What is `chattr +x` used for?

The chattr(1) manpage describes the x attribute as: x The 'x' attribute can be set on a directory or file. If the attri‐ bute is set on an existing directory, it will be inherited by ...
Evan Krall's user avatar
0 votes
0 answers
62 views

macOS ACL settings - unable to delete Time Machine backup left-over files

(macOS Ventura - MacBook Pro M1) I have deleted Time Machine backup file manually!! (my bad). Now I am left with files in my .Trashes folder that I cannot delete, no matter what I try. I have enabled ...
cem ozel's user avatar
1 vote
1 answer
328 views

What is the difference between the chattr and setfattr command

At the Veeam Documentation, I read that the chattr and setfattr commands need to be supported: https://helpcenter.veeam.com/docs/backup/vsphere/hardened_repository_limitations.html?ver=110 I have ...
Nightscape's user avatar
1 vote
1 answer
510 views

Unable to delete root-owned file under /tmp

The file and folder are owned by root but I did sudo chmod ugo+rw on both, which I confirmed with ls -l. Still, I cannot remove the file as normal user. ❯ ls -ld /tmp /tmp/perm drwxrwxrwt 46 root root ...
xeruf's user avatar
  • 541
1 vote
1 answer
360 views

What is this strange SELinux attribute on several of my files?

I have run exa --long --extended on a folder containing some wallpapers and I noticed that it returns a strange security.selinux (len 37) tag on several of my files. I'd like to know what it is and ...
telometto's user avatar
  • 1,950
1 vote
1 answer
42 views

dir permissions: delete enclosed files but not create or write to files

I want the following situation for a user's directory: user can list files user can read files user can delete files user cannot add files (ideally, also) user cannot modify files I haven't been ...
Cavalcade's user avatar
1 vote
0 answers
390 views

why there is no output of lsattr and how to resolve it

The normal output of lsattr is below # lsattr /etc/fstab ---------------- /etc/fstab but I have a host ,when I run lsattr, there is no output display to me, just like below. my os version is centos ...
Hongwei Lu's user avatar
0 votes
1 answer
126 views

How can I use the Trusted xattr namespace on FreeBSD 11.2?

I'm trying to translate whiteout files from the AUFS format to the kernel-overlay FS format. This entails marking certain directories with the extended attribute trusted.overlay.opaque = y. ...
Anaxagoras's user avatar
0 votes
1 answer
484 views

Does the rsync "-a" option exclude the "-A" and "-X" option?

Rsync describes the -a or --archive mode as being equivalent to the options.-rlptgoD (no -H,-A,-X). The -A and -X options are ambiguous and iit is not clear whether they are included or excluded. -A ...
vfclists's user avatar
  • 7,487
0 votes
1 answer
260 views

lgetxattr can't get security.capability

Background : in ima-evm-utils I found lgetxattr() can't return expected value.I wrote a simple c program to verify it. #include <sys/types.h> #include <sys/xattr.h> #include <stdio.h>...
Lee Bruce's user avatar
3 votes
1 answer
166 views

AWK return path for files with NF <= 2

I think I'm close here but I'm missing something stupid. I'm trying to make awk print out the filenames for files that are missing extended attributes or are missing an attribute value. So a file will ...
bcHelix's user avatar
  • 75
0 votes
2 answers
267 views

How to make a folder can't be deleted and be modified folder name. But you can still add files in it?

I want to make a shared disk with people online using ubuntu VPS. So as the title says, I want to make a folder can't be deleted and be modified folder name. But you can still add files in it (it's ...
peilin's user avatar
  • 1
1 vote
1 answer
414 views

Ideas to clear user xattrs from files without get/setfattr

I have a directory containing a root filesystem that I SquashFS and then mount as r/o on other boxes. However, before SquashFS'ing, i want to clear all the user-namespace xattrs from the filesystem. ...
David Davidson's user avatar
0 votes
1 answer
323 views

Using ntfs-3g, how to parse Windows extended attributes automatically?

Using xattrs, one can access Windows extended attributes using the following command getfattr -h -n system.ntfs_ea Ntfs_Mount_Point/some_file The problem is instead of an attribute list, it returns a ...
user2284570's user avatar
0 votes
2 answers
250 views

A directory that is owned by some non-superuser, but can't be deleted by them

Is it possible to create a directory that its owner can't delete? Let's say I have directory bar owned by user foo, and I'd like to create a subdirectory bar/baz, also owned by foo, such that: foo ...
Cactus's user avatar
  • 825
2 votes
1 answer
605 views

Append only attribute for directories

I want to create a directory which is undeletable, and that you can only add files, not delete any file therein. I was reading the man chattr page and I came across attribute a A file with the 'a' ...
João Pimentel Ferreira's user avatar
-1 votes
1 answer
613 views

Find "latest" path, filename, date, and time at every level of a folder subtree with Bash [closed]

Using Bash, I want to find for any specified directory and its subtree the filename, creation_date and creation_time for the file last created in that directory. For example, the output would be: /...
prat's user avatar
  • 9
0 votes
1 answer
216 views

How to lsattr directory only?

I have a directory called pub on a Ubuntu 20.04 server, that I wish to protect from deletion, and I found https://askubuntu.com/questions/504151/how-to-prevent-directory-from-being-deleted-by-user so ...
sdbbs's user avatar
  • 480
2 votes
1 answer
173 views

Bug or feature: Cannot link immutable file

I had set the immutable attribute for a file that shouldn't be changed until it is deleted (The file was a backup image of a virtual machine). As it seems the file also cannot be hard-linked, i.e. it ...
U. Windl's user avatar
  • 1,377
0 votes
1 answer
257 views

Set immutable bit for specified time

It's possible to set immutable bit for a specified range of days? I was trying to understand how Veeam11 can change the attribute after a few days for immutable backup
scaldezu's user avatar
1 vote
0 answers
105 views

Mount disk of non-selinux machine on machine with selinux enabled

I have a backup server, which has selinux enabled. It has an external hard drive attached to it to store the backups (ext4). I also have a workstation which has selinux disabled. If I run rsync from ...
Rotareti's user avatar
  • 873
1 vote
1 answer
169 views

Can stat show if file is hidden?

I'm using stat like this: stat -f "%Sp %p %l %Su %u %Sg %g %z %a %N %Y" /* I need also to tell if the file is hidden or not (MacOS). The . notation is not enough. MacOS hides more files. ...
PerfectGamesOnline.com's user avatar
2 votes
1 answer
2k views

/usr/bin/ssh and /usr/sbin/sshd can't be moved to update openssh-server and openssh-client because of immutable attribute

Ubuntu Server can't be upgraded because it says that openssh-sftp-server package have unmet dependencies The following packages have unmet dependencies: openssh-sftp-server : Depends: openssh-client (...
Lucio Queiroz's user avatar
3 votes
1 answer
1k views

How to apply and use Rich Access Control Lists with BTRFS

I am just learning about Rich Access Control Lists on Linux. My immediate objective is to give members of the group the same rights as the owner for a subdirectory tree (all files and directories ...
MountainX's user avatar
  • 17.9k
0 votes
1 answer
276 views

rsync --itemize-changes lists some xattr differences, but getfattr shows no difference

On my Arch Linux machine, I want to verify btrfs backups of snapshots using rsync. The following rsync command is used to check for changes: sudo rsync -n --itemize-changes --checksum -a --delete --...
Nox997's user avatar
  • 13
1 vote
0 answers
23 views

Prevent deletion of folder by accidentally moving or deleting parent folder that has no immutable attribute [duplicate]

In the PARENT_FOLDER I store subfolders with some works I am producing each week, e.g. right now I have these contents: ~/PARENT_FOLDER/StuffProducedTwoWeeksAgo/... ~/PARENT_FOLDER/...
Mephisto's user avatar
  • 1,077
2 votes
1 answer
1k views

Btrfs - max xattr size?

What is actual max allowed size of btrfs xattr? I tried to test this on few systems and got entirely different results (between 11kB and 15kB) so I'm not sure what actually determines this size and ...
Lapsio's user avatar
  • 1,323
3 votes
1 answer
708 views

crontab -e, permission denied after malware infection

Caused by: My machine was infected with the redis mining worm Here are some files under /root/.ssh (it's hidden, using ls -la I can see it), I remove them and some other related files, hope it won't ...
New Soul's user avatar
5 votes
3 answers
5k views

How to make a symlink read only (`chattr +i /location/symlink`)?

How can we lock a symlink so it cannot be deleted? With a normal file/directory chattr +i /file/location can achieve this but doing so with a symlink we get chattr: Operation not supported while ...
intika's user avatar
  • 14.3k
2 votes
2 answers
2k views

How do I delete an immutable encrypted file?

I was experimenting with encryption on an ext4 filesystem and I encrypted a file (using fscrypt) which was set to be immutable (via chattr +i). I have now lost the encryption key and uninstalled ...
tstsr's user avatar
  • 148
3 votes
1 answer
312 views

How to protect folder from being removed/moved, but no constraint for files inside

Here's what I want to achieve: I want to protect folder /mnt/sdmmc0p2/test from being removed or moved, but files inside can be removed. I try to use chattr +a /mnt/sdmmc0p2/test, but fail. ~# ...
Yu-Ting Chen's user avatar
2 votes
0 answers
213 views

lsattr returns different results depending on how it's run

I'm using lsattr on a linux container on the contents of a mounted drive that's been mounted using SAMBA and am seeing some interesting results. If I run lsattr in quick succession, I get differing ...
khalid13's user avatar
  • 121
9 votes
1 answer
13k views

In docker, "chattr: Operation not permitted while setting flags on file"

I'm ssh'ed into a local Centos 7 docker container* and I'm trying to run sudo chattr +i file1 but I'm getting an error: chattr: Operation not permitted while setting flags on file1 What's going on ...
Benjamin Berman's user avatar
0 votes
1 answer
176 views

How to make files undeletable but moveable in linux server?

I am managing some folders on our server. The server runs: REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux" REDHAT_SUPPORT_PRODUCT_VERSION="7.6" I have created a directory in "/srv/" and named it "...
Dr. Lenny's user avatar
4 votes
1 answer
256 views

How does cd's "-@" parameter work?

bash's man page (and help cd) mentions that cd supports a -@ parameter ("on systems that support it") to "present a file with extended attributes as a directory containing the file attributes" Is ...
Gert van den Berg's user avatar
2 votes
1 answer
2k views

Is there a tool in Linux to add an extended attribute to a file?

The getfattr tool is used to get the extended attributes of a file, but is there a tool to add an extended attribute to a file?
user337998's user avatar
1 vote
0 answers
321 views

How to mount ecryptfs and preserve individual SELinux tag of underlying files?

I am trying to mount ecryptfs on a system that uses SELinux (e.g. Cent-OS), and I want to preserve the security tag of all individual underlying files. Using mount -o command I can set the security ...
Bahram's user avatar
  • 73
1 vote
2 answers
874 views

How can I prevent ROOT from deleting a directory, but still allow root to have full control of all files and subdirectories within it?

chattr +a would be perfect if it only applied to the root of directory, not everything from there on. Is there a way to limit chattr to just the one folder (e.g. the opposite of -R as is normally ...
lexar's user avatar
  • 11
0 votes
1 answer
5k views

Inappropriate ioctl for device while reading flags on <file>

I am unable to set or view file attributes using lsattr and chattr commands on Reiser File System. Following result is observed: chattr +i Temp.txt chattr: Inappropriate ioctl for device while ...
Sameer Khurd's user avatar
2 votes
1 answer
8k views

how to enable xattr support in Debian 9 (Stretch)

I have added user_xattr in ext4 but when I remount it doesn't show xattr & I installed attr & attr_dev # <file system> <mount point> <type> <options> <...
lambocrypt's user avatar
9 votes
5 answers
54k views

How to set `chattr +i` for my `/etc/resolv.conf `?

My os: debian9. The filesystem on my disk: $ sudo blkid | awk '{print $1 ,$3}' /dev/sda2: TYPE="ext4" /dev/sda1: TYPE="vfat" /dev/sda3: TYPE="ext4" /dev/sda4: TYPE="ext4" /dev/sda5: TYPE="swap" Now ...
scrapy's user avatar
  • 333
3 votes
0 answers
935 views

How to synchronize files differing only in xattr

I am using rsync to synchronize my files but I have come to a problem when in source I add some tags (or in general probably modify xattrs) to the file, no other changes and it seems that this does ...
atapaka's user avatar
  • 541
6 votes
1 answer
1k views

What are costs of storing xattrs on ext4, btrfs filesystems?

I imagine that adding n xattrs of length l of to f files and d directories may generate costs: storage path resolution time / access time ? iteration over directories? (recursive find over (fresh ...
Grzegorz Wierzowiecki's user avatar
1 vote
0 answers
78 views

Ftp'd files have secure deletion attribute set

I have recently upgraded to a LAMP server running on Centos 7, with vsftpd for uploading files. As a hack, I use the secure deletion attribute to tag certain files to keep track of which ones ...
Jerry Davis's user avatar
2 votes
1 answer
3k views

Cannot set file attribute

I'm trying to use setfattr, but always get Operation not supported In my home directory, I'm doing the following: touch delete.me setfattr -n naomi -v washere delete.me This returns setfattr: ...
pandita's user avatar
  • 763
1 vote
0 answers
378 views

let rm truncate files

A friend of mine has one directory (/var/mail) on his Linux machine where rm seems to truncate files if he has no write permissions on the directory. I like this feature and wonder how could I do the ...
rudimeier's user avatar
  • 10.3k