RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login
    Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

    Root password

    Scheduled Pinned Locked Moved Help and Support
    rootsudoers
    3 Posts 3 Posters 1.9k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      spud11
      last edited by

      I've very stupidly managed to change ownership of the sudoers file to pi meaning I no longer have access to sudo. I get the response sudo: /etc/sudoers is owned by uid 1000, should be 0. I've tried pkexec chown root:root /etc/sudoers /etc/sudoers.d -R but of course I have not set up a password for root before. Could someone help me please? Thanks.

      RetroPie v4.4.1 • RPi3 Model B • 5.1V 2.5A PSU • 32GB SanDisk Extreme microSD • 2TB Toshiba Canvio Basics Portable USB 3.0 hard drive • 4 x DragonRise USB Arcade joysticks • 2 x TurboTwist spinners • 1 x USB trackball • 1 x PS4 wireless • 1 x 8BitDo Zero

      edmaul69E 1 Reply Last reply Reply Quote 0
      • edmaul69E
        edmaul69 @spud11
        last edited by

        @spud11 if you want to get more attention to your issue you should change the title to more show your issue.

        1 Reply Last reply Reply Quote 0
        • SanoS
          Sano
          last edited by Sano

          IIRC there is no root password.
          Single user mode won't help as it requires root password too, and you need to be root to edit /boot/cmdline.txt in order to remove this.
          So you can :

          • use a windows computer to add init=/bin/sh at the end of cmdline.txt in the /boot (fat) partition of the SD card
          • use a linux computer (live distro if you don't have one), then mount root partition of the SD card and change ownership of sudoers.
          1 Reply Last reply Reply Quote 0
          • First post
            Last post

          Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.

          Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.