exam questions

Exam 102-500 All Questions

View all questions & answers for the 102-500 exam

Exam 102-500 topic 1 question 26 discussion

Actual exam question from LPI's 102-500
Question #: 26
Topic #: 1
[All 102-500 Questions]

Which of the following steps prevents a user from obtaining an interactive login session?

  • A. Setting the UID for the user to 0.
  • B. Running the command chsh -s /bin/false with the user name.
  • C. Removing the user from the group staff.
  • D. Adding the user to /etc/noaccess.
  • E. Creating a .nologin file in the user's home directory.
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
bogvt
Highly Voted 2 years, 4 months ago
it is chsh -s /bin/false username
upvoted 18 times
Jodelo
1 year ago
Correct
upvoted 1 times
...
...
lucaverce
Most Recent 1 month, 3 weeks ago
Selected Answer: B
B is correct, but there must be a bad typo in that ""s Running the command chsh -s /bin/false with the user name.
upvoted 2 times
...
Roger95
8 months ago
chsh -s /bin/false user1 chsh -s /sbin/nologin => same behaviour, but differrent. false -> reject to execute nologin -> pam check and reject to login, then execute the message as below examples. ================================== [root@rhel8-02 ~]# grep user1 /etc/passwd user1:x:1001:1001::/home/user1:/sbin/nologin [root@rhel8-02 ~]# su user1 This account is currently not available. [root@rhel8-02 ~]# [root@rhel8-02 ~]# chsh -s /bin/false user1 Changing shell for user1. chsh: Warning: "/bin/false" is not listed in /etc/shells. Shell changed. [root@rhel8-02 ~]# grep user1 /etc/passwd user1:x:1001:1001::/home/user1:/bin/false [root@rhel8-02 ~]# su user1 [root@rhel8-02 ~]#
upvoted 3 times
...
ledlong
9 months, 3 weeks ago
if we use nologin, it should be place in /etc folder and it will reject all users except root from logging in the system. But the question asks for "a user" not for all users, so we can change the path of bash shell in /etc/passwd file to /bin/false by using the command: chsh -s /bin/false username
upvoted 3 times
...
georgerobel
1 year, 4 months ago
chsh -s /bin/false username
upvoted 3 times
...
EnemyTurret
1 year, 6 months ago
its supposed to be /usr/sbin/nologin
upvoted 2 times
...
rjlg2centos8
1 year, 8 months ago
but supposing that the shell is in this file, the option is correct
upvoted 1 times
...
rjlg2centos8
1 year, 8 months ago
"chsh -s /bin/false" is not correct, because chsh only cans change to a shell that is in the /etc/shells file, and /bin/false is not in this file, so if you execute this command you probably will get an error
upvoted 1 times
Negator
1 year, 1 month ago
from the NOTE section of the chsh man page ... "The only restriction placed on the login shell is that the command name must be listed in /etc/shells, unless the invoker is the superuser, and then any value may be added." So if the invoker is superuser or sudo is used this works. I have tried this with sudo and it works as intended.
upvoted 1 times
...
...
3glag
2 years, 3 months ago
correct answer is E nologin file
upvoted 3 times
katieK
2 years, 1 month ago
yes, but in the /etc directory, not in the /home. so correct answer is chsh -s /bin/false
upvoted 4 times
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago