Every file has an owner, a group, and read, write and execute permissions for the owner, the group and everyone else, often written in octal such as 644 or 755. On a directory, read lists names, write creates or deletes entries, and execute allows entering it. Setuid makes a program run as its owner, which is how passwd edits protected files. The sticky bit on a directory such as /tmp lets only a file's owner delete it.
Why interviewers ask this
Permissions are a fundamental part of Linux administration and a common source of both outages and security holes. The interviewer wants the basic model, the slightly unintuitive meaning of permissions on directories, and the special bits. Understanding why setuid binaries are a security concern, and when to reach for ACLs or group ownership instead of opening permissions to everyone, shows practical judgement.
How to structure your answer
- Explain owner, group and others with read, write and execute.
- Explain how the bits behave differently on directories.
- Describe setuid, setgid and the sticky bit.
- Mention umask, ACLs and the security angle.
Example answer
Every file has an owner and a group, and three sets of permissions: for the owner, for members of the group, and for everyone else. Each set has read, write and execute, usually written in octal, so 644 means the owner can read and write while everyone else can only read, and 755 adds execute for all. Directories are where people get caught out. Read lets you list names, execute lets you enter the directory and reach files inside, and write lets you create, rename or delete entries, so someone with write on a directory can delete a file they cannot even read. Then the special bits. Setuid on a program makes it run with its owner's privileges, which is how passwd can update protected files, and why setuid root binaries are worth auditing. Setgid on a directory makes new files inherit its group, which is handy for shared project folders. The sticky bit on a shared directory like /tmp means only a file's owner can delete it. Default permissions come from the umask, and ACLs cover cases the basic model cannot.
Walking into this interview soon? GhostPilot listens to your live call, spots the question the moment it is asked, and puts a structured answer on your screen in real time. Try it on your next mock, or grab a $29 Session Pass, no subscription, for the real thing.
See how it worksFollow-up questions to expect
- How would you set up a shared folder that several users can write to?
- How would you find every setuid binary on a system?
- What does a umask of 027 mean for new files?
Related systems administrator questions
Your interviewer will ask their own version of this. Paste your actual job description into the free Question Predictor and get the 20 questions that role is most likely to ask, with what each one is really probing.
Predict my questions