[SOLVED] sudo password request after upgrade to 6.22.3 Topic is solved

Having issues with your DietPi installation, or, found a bug? Post it here.
Post Reply
AndrewZ
Posts: 19
Joined: Mon May 01, 2017 4:34 pm

[SOLVED] sudo password request after upgrade to 6.22.3

Post by AndrewZ »

Just upgraded to 6.22.3 on 2 hosts
host#1 - no problems, plain password ssh login if that matters
host#2 - ssh key-based auth, after entering a passphrase additional request comes up:
[sudo] password for {username}:
- this is something new!

Pressed ^C here and noticed the following:
Waiting for DietPi-Postboot to finish... (Press CTRL+C to abort) (0)
Last edited by AndrewZ on Fri Mar 29, 2019 10:31 am, edited 1 time in total.
monery
Posts: 3
Joined: Sat Mar 02, 2019 6:18 pm

Re: sudo password request after upgrade to 6.22.3

Post by monery »

Also running 6.22.3, on a Raspi 3B+. Happens when bash starts regardless if opened from LXterminal inside LXDE or via a tty. Also happened on my Odroid HC1 so its not just Raspi image
varaki
Posts: 2
Joined: Wed Jan 30, 2019 12:56 pm

Re: sudo password request after upgrade to 6.22.3

Post by varaki »

Hi!

Occurred on my Odroid-XU4, too.
I managed to fix it by removing the sudo before the systemctl checker loop that checks whether the dietpi-postboot is finished (ergo service status is exited or not)
That command works without sudo as well.
Just simply run the following command, and it will do the trick :)

Code: Select all

sudo sed -i 's%\(until \)\(sudo \)\(systemctl\)%\1\3%g' /DietPi/dietpi/dietpi-login
AndrewZ
Posts: 19
Joined: Mon May 01, 2017 4:34 pm

Re: sudo password request after upgrade to 6.22.3

Post by AndrewZ »

thanks to @varaki, solved
User avatar
MichaIng
Site Admin
Posts: 2421
Joined: Sat Nov 18, 2017 6:21 pm

Re: [SOLVED] sudo password request after upgrade to 6.22.3

Post by MichaIng »

@AndrewZ @varaki @monery
Yeah indeed this happens when logging in with a user that has no sudo permissions without password. It even loops if there are no sudo permissions at all.

The better/best solution which I implemented for v6.23 is btw to replace the line with:

Code: Select all

while pgrep -f '/DietPi/dietpi/postboot' &> /dev/null
"pgrep" is the simpler and faster command to do the intended check and does not require root permissions.

See: https://github.com/MichaIng/DietPi/issues/2667
AndrewZ
Posts: 19
Joined: Mon May 01, 2017 4:34 pm

Re: [SOLVED] sudo password request after upgrade to 6.22.3

Post by AndrewZ »

thanks, @MichaIng
fixed the script on 2 hosts as you suggested
monery
Posts: 3
Joined: Sat Mar 02, 2019 6:18 pm

Re: sudo password request after upgrade to 6.22.3

Post by monery »

varaki wrote: Thu Mar 28, 2019 10:11 pm

Code: Select all

sudo sed -i 's%\(until \)\(sudo \)\(systemctl\)%\1\3%g' /DietPi/dietpi/dietpi-login
worked perfectly on pi3 image. Thx bunches
Post Reply