Openhabian not in sudoers file

Hi there, I just made a huge mistake, in trying to add my openhabian user into the gpio group, I apparantly removed my openhabian user from the sudo group…

Is there any other sudo user I can use to fix this?

should’ve gone to bed hours ago, but wanted to get this shellscript working… :frowning:

Fixed by:

  1. opening the sdcard on my pc
  2. adding ‘init=/bin/sh’ to the end of cmdline.txt to enter single user mode
  3. run su to be root
  4. add the openhabian user back to the sudo group ‘usermod -aG sudo openhabian’
  5. remove the ‘init=/bin/sh’ from the end of cmdline.txt

And you’re all set :slight_smile:

1 Like

You don’t have to restart the Raspberry Pi by the way. And the above line has an error. It should be sudo usermod -aG sudo openhabian without the word group. Without restarting the Raspberry Pi you can connect to pi@<ip> and the password is raspberry. The pi user have sudo permissions and you can add the openhabian user to sudo.

(I answered because it was the first topic you can find with this error).

hmmm. The openhabian ( “distribution” ) that I use does not have a user that is called pi.