Sample Header Ad - 728x90

SUID bit ignored when creating files / directories

1 vote
2 answers
206 views
I've set the SUID & SGID bit on a folder belonging to user *foo* with sudo chmod g+s myfolder & sudo chmod u+s myfolder drwsr-sr-x 24 foo www-data 4,0K Okt 25 16:17 myfolder Then I went inside and created a folder with sudo mkdir xyz, but the user of the folder gets overwritten with root while the group was protected successfully. drwxr-sr-x 2 root www-data 4,0K Okt 25 16:24 xyz I expect the user to be protected, it should stay at foo after executing sudo mkdir xyz. What have I missed?
Asked by Black (2138 rep)
Oct 25, 2022, 02:26 PM
Last activity: Oct 26, 2022, 07:36 AM