Page 1 of 1

I want to complete the shutdown without entering a password.

Posted: Thu May 23, 2024 8:51 am
by wkgiztk
Please treat me well.
I want to complete the shutdown without entering a password.

I have installed and used the desktop "lxde" on ubuntu22.04.
(1)
When you press the shutdown button, you will need to select your ID and enter your password.
I would like to be able to shut down this without entering a password.

with sudoers (visudo)
I tried %groupname ALL=NOPASSWD: /sbin/shutdown, but for some reason it doesn't work.
I went to look at the official website of lxde, but the wiki shows 404 Not Found and I can't see it.

(2)
I would like to force the created user to change their password when they log in for the first time.

I know that I can force it by running chage -d 0 username, but similarly to (1), I can't do that on lxde.


Thank you very much for your understanding.

Re: I want to complete the shutdown without entering a password.

Posted: Thu May 23, 2024 1:48 pm
by Rex Bouwense
As far as I know there is no requirement to select your user name and enter a password to shut the computer down using any desktop environment. You will be warned that others are signed in (if there are any) but you will not be prohibited from turning the computer off.
Assuming you are an administrator you can force a user to create a new password in Ubuntu by selecting that option when you create the user.

Re: I want to complete the shutdown without entering a password.

Posted: Wed Sep 18, 2024 2:33 am
by lilycollins34
To resolve your issues:Incredibox game

Shutdown Without a Password: Ensure that your sudoers configuration is correctly set. Use sudo visudo and add:

css
Copy code
username ALL=(ALL) NOPASSWD: /sbin/shutdown
Replace username with your actual username. If you use a group, ensure the group name is correct and that the path to shutdown is accurate. LXDE may have its own shutdown script, so check if it correctly uses sudo.

Force Password Change on First Login: You can use chage -d 0 username to force a user to change their password on first login. This command should work regardless of the desktop environment.