How to disable a user for login ?

Please post suggestions for improvement of Cinnamon on:
https://github.com/linuxmint/Cinnamon
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
xtrailrunner
Level 1
Level 1
Posts: 29
Joined: Mon Jan 16, 2012 6:08 am

How to disable a user for login ?

Post 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
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
Pjotr
Level 23
Level 23
Posts: 19877
Joined: Mon Mar 07, 2011 10:18 am
Location: The Netherlands (Holland) 🇳🇱
Contact:

Re: How to disable a user for login ?

Post 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.
Tip: 10 things to do after installing Linux Mint 21.3 Virginia
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 21
Level 21
Posts: 13192
Joined: Fri Sep 05, 2008 5:33 am
Location: Perth, AU.

Re: How to disable a user for login ?

Post by Pierre »

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: 29
Joined: Mon Jan 16, 2012 6:08 am

Re: How to disable a user for login ?

Post by xtrailrunner »

So, who is right? I don't want to experiment by removing users and losing their account.
User avatar
catweazel
Level 19
Level 19
Posts: 9763
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: How to disable a user for login ?

Post 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.
"There is, ultimately, only one truth -- cogito, ergo sum -- everything else is an assumption." - Me, my swansong.
User avatar
all41
Level 19
Level 19
Posts: 9498
Joined: Tue Dec 31, 2013 9:12 am
Location: Computer, Car, Cage

Re: How to disable a user for login ?

Post 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.
Everything in life was difficult before it became easy.
xtrailrunner
Level 1
Level 1
Posts: 29
Joined: Mon Jan 16, 2012 6:08 am

Re: How to disable a user for login ?

Post 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 !
Cosmo.
Level 24
Level 24
Posts: 22968
Joined: Sat Dec 06, 2014 7:34 am

Re: How to disable a user for login ?

Post 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.
User avatar
catweazel
Level 19
Level 19
Posts: 9763
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: How to disable a user for login ?

Post 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.
"There is, ultimately, only one truth -- cogito, ergo sum -- everything else is an assumption." - Me, my swansong.
xtrailrunner
Level 1
Level 1
Posts: 29
Joined: Mon Jan 16, 2012 6:08 am

Re: How to disable a user for login ?

Post 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.
Locked

Return to “Cinnamon”