How to disable a user for login ?

Please post suggestions for improvement of Cinnamon here
https://github.com/linuxmint/Cinnamon
Post Reply
xtrailrunner
Level 1
Level 1
Posts: 19
Joined: Mon Jan 16, 2012 6:08 am

How to disable a user for login ?

Post by xtrailrunner » Wed Jan 03, 2018 7:49 am

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

User avatar
Pjotr
Level 20
Level 20
Posts: 10973
Joined: Mon Mar 07, 2011 10:18 am
Location: The Netherlands (Holland)
Contact:

Re: How to disable a user for login ?

Post by Pjotr » Wed Jan 03, 2018 8:02 am

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.
Tip: 10 things to do after installing Linux Mint 19 Tara
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.

User avatar
Pierre
Level 17
Level 17
Posts: 7566
Joined: Fri Sep 05, 2008 5:33 am
Location: Perth, AU.

Re: How to disable a user for login ?

Post by Pierre » Wed Jan 03, 2018 9:34 am

actually - - you may not be able to remove both unwanted users from the login screen,
- without removing their account .. ..
Image
Please edit your original post title to include [SOLVED] - when your problem is solved!
and DO LOOK at those Unanswered Topics - - you may be able to answer some!.

xtrailrunner
Level 1
Level 1
Posts: 19
Joined: Mon Jan 16, 2012 6:08 am

Re: How to disable a user for login ?

Post by xtrailrunner » Tue Jan 09, 2018 2:35 am

So, who is right? I don't want to experiment by removing users and losing their account.

User avatar
catweazel
Level 17
Level 17
Posts: 7754
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: How to disable a user for login ?

Post by catweazel » Tue Jan 09, 2018 2:43 am

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.
¡uʍop ǝpısdn sı buıɥʇʎɹǝʌǝ os ɐıןɐɹʇsnɐ ɯoɹɟ ɯ,ı

User avatar
all41
Level 13
Level 13
Posts: 4857
Joined: Tue Dec 31, 2013 9:12 am
Location: Computer, Car, Cage

Re: How to disable a user for login ?

Post by all41 » Tue Jan 09, 2018 3:05 am

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.
Proud to be a supporter and monthly contributor to Mint.

xtrailrunner
Level 1
Level 1
Posts: 19
Joined: Mon Jan 16, 2012 6:08 am

Re: How to disable a user for login ?

Post by xtrailrunner » Tue Jan 09, 2018 7:06 am

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 !

Cosmo.
Level 23
Level 23
Posts: 17829
Joined: Sat Dec 06, 2014 7:34 am

Re: How to disable a user for login ?

Post by Cosmo. » Tue Jan 09, 2018 7:27 am

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.

User avatar
catweazel
Level 17
Level 17
Posts: 7754
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: How to disable a user for login ?

Post by catweazel » Tue Jan 09, 2018 7:35 am

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.
¡uʍop ǝpısdn sı buıɥʇʎɹǝʌǝ os ɐıןɐɹʇsnɐ ɯoɹɟ ɯ,ı

xtrailrunner
Level 1
Level 1
Posts: 19
Joined: Mon Jan 16, 2012 6:08 am

Re: How to disable a user for login ?

Post by xtrailrunner » Tue Jan 09, 2018 8:06 am

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.

Post Reply

Return to “Cinnamon”