Page 1 of 1

How to disable a user for login ?

Posted: Wed Jan 03, 2018 7:49 am
by xtrailrunner
Using Mint 18.3 with Cinnamon I have the following issue:
- beside my own user two other users are beeing offered on the login screen at startup
- changing the login shell in /etc/passwd to /bin/false or to /usr/sbin/nologin does not help although there are a lot more users with these settings which do not appear on the login screen
- opening "Users and Groups" from the settings menu show only the users which appear on the login screen. I don't want to remove them there because I don't know what happens.

How can I remove both unwanted users from the login screen without removing their account ?

Regards
Juergen

Re: How to disable a user for login ?

Posted: Wed Jan 03, 2018 8:02 am
by Pjotr
You can safely remove those unwanted accounts with "Users and Groups", provided that none of them was the original admin account with which the system was first installed.

Re: How to disable a user for login ?

Posted: Wed Jan 03, 2018 9:34 am
by Pierre
actually - - you may not be able to remove both unwanted users from the login screen,
- without removing their account .. ..

Re: How to disable a user for login ?

Posted: Tue Jan 09, 2018 2:35 am
by xtrailrunner
So, who is right? I don't want to experiment by removing users and losing their account.

Re: How to disable a user for login ?

Posted: Tue Jan 09, 2018 2:43 am
by catweazel
xtrailrunner wrote:So, who is right? I don't want to experiment by removing users and losing their account.
Pierre is correct. Pjotr seems to have answered a different question. I do that often :)

There is a way to prevent local login for new users, but not for existing users.

If you want to deny local login to new users, see this.

If you simply want to hide user names of people who use the machine without clobbering anything, pick a login theme that doesn't display user names but instead requires you to type your user name.

Re: How to disable a user for login ?

Posted: Tue Jan 09, 2018 3:05 am
by all41
How to disable a user for login ?
Just change that user password in 'Users and Groups' will do that.
only superuser (root) privilege can do this.
I don't want to experiment by removing users and losing their account.
When you remove users using the 'Users and Groups' utility you will have a choice to remove just the user, their folders, and the accounts.
only superuser (root) privilege can do this.

Re: How to disable a user for login ?

Posted: Tue Jan 09, 2018 7:06 am
by xtrailrunner
For example there is a user "Libvirt Qemu". If I press the button "Delete" I get the alert:
Are you sure you want to permanently delete libvirt-qemu and all the files associated with this user?
I don't want to remove the user and his files. I only want to prevent the user from being selectable at the login screen.
Thanks !

Re: How to disable a user for login ?

Posted: Tue Jan 09, 2018 7:27 am
by Cosmo.
2 easy methods you can use:

Enter in the terminal (of the main account) sudo passwd -d user_name (user_name has to be replaced): The password will get deleted, so the user cannot log in any more.

Or you enter sudo passwd -l user_name; with this the password gets deactivated, but preserved for later usage. If you want to activate it later again you enter sudo passwd -u user_name. Advantage: You don't need to tell the user at the later time the new password, he can now use it just as before.

Note, that Mint puts every new account (except the primary) by default into the group nopasswdlogin. You need to remove the user from this group, otherwise he can login without a password. You can do this with Users & Groups.

If you want to check the status of the passwords for the accounts on the system enter sudo passwd -aS. In the list you get a P for active passwords, L for deactivated passwords and NP for no password set.

Re: How to disable a user for login ?

Posted: Tue Jan 09, 2018 7:35 am
by catweazel
xtrailrunner wrote:For example there is a user "Libvirt Qemu". If I press the button "Delete" I get the alert:
Are you sure you want to permanently delete libvirt-qemu and all the files associated with this user?
I don't want to remove the user and his files. I only want to prevent the user from being selectable at the login screen.
Thanks !
That would have been helpful had it been mentioned earlier.

See this link.

Re: How to disable a user for login ?

Posted: Tue Jan 09, 2018 8:06 am
by xtrailrunner
OK. Thanks, I could remove libvirt-qemu from the login screen. What about a second user "openkm" with UID 1001 and GID 1001 ?
Should I use the same procedure? The login shell is set to /bin/false but the user still appears on the login screen.