Pi user sicher aber nicht der root user

wie kann ich den pi so einstellen das er mich nach dem root passwort fragt wenn ich sudo -i eingebe. der pi user ist ja schon gesichert mit passwort nur root bekomme ich nicht gesetzt und abgefragt.

Are you using Raspbian? What user are you when you try sudo -i?

Deine Beobachtung ist die Standardkonfiguration von Raspbian, und damit kein Grund zur Sorge :slight_smile:

Ich vermute mal, es wird deswegen nicht nach einem Kennwort gefragt, weil der Benutzer pi Mitglied in der Gruppe sudo ist.

groups pi

Zudem könnte die Anwort auf die Frage

sudo -i eliminates the need for a password. Isn't that a problem for security reasons?

hilfreich sein:

habs grade getestet leider wird mir nur mehrere vorschläge angezeigt wie ich den befehl nutzen könnte. aber trotzdem danke für die hilfe und den hinweiß link.

im using stretch buster wasnt working for me.
pi user is in an admin group thats what i know, it was a long time ago that I used linux, there it was so that I could use a lot only with sudo -i, without it usually did not work.

If it's Raspbian then pi is allowed passwordless sudo by default. See Always request password when using sudo - Raspberry Pi Forums (English) for a way to adjust that.

Edit: TLDR

sudo nano /etc/sudoers.d/010_pi-nopasswd

There's only one line:
pi ALL=(ALL) NOPASSWD: ALL
Change it to
pi ALL=(ALL) PASSWD: ALL

1 Like

thx that fixed it.