1

Hello Professionals,

can I create a No-Login-Account, which neither su nor Login should be possible on this account?

What I've tried:

First Method:

Creating without home directory:

usseradd -M Test
usermod -L Test

Second Method:

And according to documentations,

useradd -r Test

when i use the su command to login, it is still able to log in.

thanks for your help.

1 Answers1

2
usermod --shell /sbin/nologin Test

P.S. Linux user accounts names are normally lowcase and can only contain a-Z 0-9 and a dot (. - except the first or last symbol)

  • thanks a lot. may I ask, what for do we need such accounts? I am just trying scripting form one online exercises, therefore I am not well known with Linux OS – Naseer Akbari Aug 28 '20 at 13:42
  • https://unix.stackexchange.com/questions/155139/does-usr-sbin-nologin-as-a-login-shell-serve-a-security-purpose – Artem S. Tashkinov Aug 28 '20 at 13:50