Questions tagged [sticky-bit]
21 questions
66
votes
1 answer
What did the sticky bit originally do when applied to files?
In various places one can see the "sticky bit" accused of nowadays being a complete misnomer, as its functionality nowadays is to affect the write permissions on directories and act as a restricted deletion flag.
In an AskUbuntu answer the answerer…
JdeBP
- 66,967
- 12
- 159
- 343
9
votes
2 answers
Why would a directory have the sticky bit set without the executable bit?
In Ubuntu 14.04, listing the contents of the directory /var/spool/cron with ls -l provides the following permissions on the directories within (irrelevant columns snipped):
drwxrwx--T daemon daemon atjobs
drwxrwx--T daemon daemon atspool
drwx-wx--T…
Q23
- 413
- 3
- 11
7
votes
1 answer
how do you find all files and directories without sticky bit?
how do you find all files and directories without sticky bit?
I have a bunch of old files that I need to delete so I use: find . -mtime +3 -a \( -type f -o -type d \)
But then this find command will still find files with sticky bit permission:…
Trevor Boyd Smith
- 3,772
- 12
- 36
- 44
4
votes
1 answer
How to create a directory, where users can delete only their own files, but one user can delete anyone's files?
Consider the following setup:
# two users in groups sales
useradd edwin
useradd santos
groupadd sales
usermod -aG sales edwin
usermod -aG sales santos
# two users in group account
useradd serene
useradd alex
groupadd account
usermod -aG account…
KamilCuk
- 850
- 8
- 16
3
votes
1 answer
How does the sticky bit help at all?
The way I understand the sticky bit on directories is that only the owner of a file within that directory can delete the file, instead of everybody with write permission.
I don't get, though, where that would be actually useful. If everybody can…
Tim
- 33
- 2
3
votes
0 answers
Removing a directory (that contains subdirectories) from a directory that has sticky bit
This is my setup
[root@ ~]# mkdir /sticky01
[root@ ~]# chown user01:user01 /sticky01
[root@ ~]# chmod a+rwx /sticky01
[root@ ~]# chmod +t /sticky01
[root@ ~]# ls -ld /sticky01
drwxrwxrwt. 3 user01 user01 22 Apr 8 06:10 /sticky01
I have a directory…
Titi Wangsa bin Damhore
- 141
- 4
2
votes
2 answers
Not able to give write permission to other user with ACL or chmod
Anyone know why rocky can't write to /tmp/afile? Giving rocky permission as an other user with chmod o+w doesn't seem to work either
I updated the acl with: setfacl -m u:rocky:rw /tmp/afile
id as rocky and owner:
rocky@jammy:~$ id
uid=1001(rocky)…
Newbie
- 23
- 4
1
vote
2 answers
find command - list all directories with a set sticky bit
This doesn't work
find / -type d -perm 1000
The problem is, that it matches only the exact permission (1000), but I only want to find out if the sticky bit is set or not. I don't care about the other permissions...
My solution so far
I feel that…
Pixelbog
- 540
- 2
- 17
1
vote
0 answers
Ubuntu user not affected by sticky bit on Ubuntu 22.04
I experience a strange behaviour in stick bit on /tmp directory and flock command. Tried with two cases:
Case 1: create file with Ubuntu user, root have no access to the created file.
ubuntu@:~$ touch -a /tmp/ubuntu_user_created.lck
ubuntu@:~$ flock…
Tien Dung Tran
- 131
- 3
1
vote
3 answers
rsync not setting stickybit / GID bit
Using the following rsync command, the RWX permissions are being correctly set for both files and directories but the sticky bit options are not.
rsync -rtvz --partial-dir=.rsync-partial --chmod=Da+t,Dg+s,D770,F0740 --progress --stats -e 'ssh -p…
ezekiel
- 167
- 6
1
vote
0 answers
sudoedit ignores sticky bit when checking for directory writability
sudoedit does not allow editing files when the original user has write access to one of the parent directories (as explained here). However, I'm noticing that sudoedit does not seem to take into account the sticky bit when performing this check.
For…
Alex Robbins
- 465
- 4
- 5
1
vote
1 answer
Why does chmod o=rwx removes sticky bit while chmod u=rwx and chmod g=rwx don't remove suid and sgid?
I'm having a problem with chmod command.
I have a directory with sgid, suid and sticky bit on.
If I then run chmod u=rwx {dirname} or chmod g=rwx {dirname} sgid and suid are still on.
But if I run chmod o=rwx sticky bit removes.
Can anyone explain…
user388601
- 13
- 2
0
votes
0 answers
0
votes
0 answers
find files with peculiar permissions set
I'm prepping for the LPIC1 exam, strongly relying on their online material here.
Can someone pls help me clarify this doubt?
What is the difference among these:
find ~ -perm 4000
find ~ -perm -4000
find ~ -perm /4000
WobblyWindows
- 727
- 1
- 9
- 24
0
votes
1 answer
stickybits setgid not working
I have structure like:
/home/reed/, user=reed, group=reed
- apache-conf, user=reed, group=reed
- apache-web, user=reed, group=apache, perm=0770
- www.website.com, user=reed, group=apache, perm=0770
- index.php, user=reed,…
Reed
- 141
- 4