@Aaron Lockhart I got a task on kodekloud engineer regarding creating a user wit . . .

Lateef Taiwo:
@Aaron Lockhart I got a task on kodekloud engineer regarding creating a user with a non-interactive shell. I was able to create the user using the command sudo useradd -s /sbin/nologin lateef .
A user with a non interactive shell will not be able to login since they can’t use the shell.

Now my question is, why do we need to create a user with a non interactive shell?
what is the essence of creating a user that will not have login access?
Please explain with use-case. Thank you

Bruno Domingues:
For a service to do a specific task. If the account gets compromised then it can’t do anything

Lateef Taiwo:
okay, thanks.
Expecting more explanations from @Aaron Lockhart

Aaron Lockhart:
Bruno gave the only real answer to the question. Non-interactive shell accounts are not for regular users. They’re for “system users” like accounts that provide services and don’t do anything else.

Lateef Taiwo:
Okay, thanks