Challenge - 5 Problems
Special Permissions Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate1:30remaining
What is the output of ls -l for a file with setuid bit set?
You run
ls -l on a file with the setuid bit set. Which of the following shows the correct permission string for that file?Linux CLI
ls -l /path/to/setuid_file
Attempts:
2 left
💡 Hint
Look for an 's' in the user execute position to indicate setuid.
✗ Incorrect
The setuid bit replaces the user execute bit with 's' if execute is set, so the permission string shows 'rws' for the user part.
💻 Command Output
intermediate1:30remaining
What does the sticky bit do on a directory?
You set the sticky bit on a directory. What effect does it have on the directory's behavior?
Linux CLI
chmod +t /tmp/shared_dir ls -ld /tmp/shared_dir
Attempts:
2 left
💡 Hint
Think about shared directories like /tmp where many users write files.
✗ Incorrect
The sticky bit on directories restricts deletion or renaming of files to the file owner, directory owner, or root, preventing others from deleting files they don't own.
📝 Syntax
advanced1:30remaining
Which chmod command sets the setgid bit on a directory?
You want to set the setgid bit on a directory named
project. Which command correctly does this?Attempts:
2 left
💡 Hint
The setgid bit is related to the group permissions.
✗ Incorrect
The setgid bit is set using 'g+s' with chmod, which applies the setgid bit to the group permissions.
🚀 Application
advanced1:30remaining
What is the effect of setgid on a directory's new files?
You set the setgid bit on a directory. What happens to the group ownership of new files created inside that directory?
Attempts:
2 left
💡 Hint
Think about how group collaboration is managed in shared directories.
✗ Incorrect
When the setgid bit is set on a directory, new files created inside inherit the directory's group ownership, facilitating group collaboration.
🧠 Conceptual
expert1:30remaining
What error occurs if a non-root user tries to set the setuid bit on a file they own?
A user tries to run
chmod u+s myscript.sh on a file they own but is not root. What happens?Linux CLI
chmod u+s myscript.sh
Attempts:
2 left
💡 Hint
Consider who has the privilege to set special permission bits.
✗ Incorrect
Only the root user can set the setuid bit on files. Non-root users get a permission denied error.