XK0-005 · Question #743
A Linux administrator is creating a user that can run the FTP service but cannot log in to the system. The administrator sets /bin/false as a login shell for the user. When the user tries to run the…
The correct answer is B. Add /bin/false entry to the /etc/shells file. The file /etc/shells is the system's whitelist of valid login shells. Many services (including FTP daemons like vsftpd) check this file to validate a user's shell before granting access. Since /bin/false is not a real shell, it is typically not listed in /etc/shells by default…
Question
A Linux administrator is creating a user that can run the FTP service but cannot log in to the system. The administrator sets /bin/false as a login shell for the user. When the user tries to run the FTP service, it is rejected with an "invalid shell: /bin/false" message. Which of the following is the best way to resolve the issue?
Options
- AChange ownership of /bin/false to the FTP user
- BAdd /bin/false entry to the /etc/shells file
- CMake /bin/false an executable file
- DChange the user's default shell to /bin/bash
How the community answered
(46 responses)- A4% (2)
- B80% (37)
- C11% (5)
- D4% (2)
Explanation
The file /etc/shells is the system's whitelist of valid login shells. Many services (including FTP daemons like vsftpd) check this file to validate a user's shell before granting access. Since /bin/false is not a real shell, it is typically not listed in /etc/shells by default, causing the 'invalid shell' rejection. Adding /bin/false as an entry in /etc/shells tells the system it is an acceptable shell, allowing the FTP service to accept the user without granting interactive login access. Option A (changing ownership) is irrelevant to shell validation. Option C (/bin/false is already executable by default). Option D (changing to /bin/bash) would grant the user full interactive login access, defeating the entire security purpose of using /bin/false.
Topics
Community Discussion
No community discussion yet for this question.