Linux User Setup with Non-Interactive Shell Doubts

Hello,

I am currently working on a task in Linux where I need to create a user with a non-interactive shell. However, I encountered an issue and the task failed. I have written the following command to create the user:
sudo -m -s /sbin/nologin username
Despite this, the task is not completing as expected. Could someone kindly guide me on what might be causing the issue or if there’s something I may be missing in the process?

sudo -m -s /sbin/nologin username
What do you think this command will do? Assuming it’s not a typo, do you feel there is something missing?

I.e. which command is used to actually add a new user account? sudo is used for running commands as a root user, but what command are you actually attempting to run?

Ohh ok useradd is missing

2 Likes