Jetbot lost sudoer

Apologies that this is not a fun machine learning problem, just a linux user error

The user jetbot is no longer a sudoer on my jetson nano. I don’t know what I did today that caused it. I noticed it when I rebooted the board and cannot get into the desktop environment.

What I did today that might have caused it:

Install Jetson.GPIO, following https://pypi.org/project/Jetson.GPIO/

sudo groupadd -f -r gpio
sudo usermod -a -G gpio jetbot

I attempted to get a DualShock 4 working, reading https://old.reddit.com/r/linux_gaming/comments/amnwjs/dualshock_4_pairing_then_instantly_disconnecting/ I used the command

sudo usermod -G input jetbot

Also I installed pyusb using apt install python-usb

Right now I am lost, I am in SSH and have SFTP but I can’t access /etc/sudoers or sudoers.d

Please tell me the Jetbot image has a root password… Otherwise, is there any way out of this mess?

I have a few other SD cards, can I put a default image on a new SD card, run it, mount the old SD card, and mess with something to get back jetbot back into sudoer?

And what exactly did I do wrong? Or what should I be more careful about? I don’t want this to keep happening. Backing up a 64GB SD card image after every step is not convenient.

Thanks

This command will wipe out all other group memberships:

sudo usermod -G input jetbot

If you want to add group input to user jetbot and not wipe out the other groups, then also use “-a”:

sudo usermod <b>-a</b> -G input jetbot

I don’t know which groups “jetbot” was a member of prior to the original usermod command, but you’ll have to add them back, or else just remove the user and recreate the user from scratch.

I think there is only one user on the JetBot image. Single user mode could fix this (cli recovery mode) but I have no idea if that even exists on the Nano of if it’s enabled.

My advice would be not to waste too much time if there is only one user on the system. Simply reflash after backing up your files via SFTP which it sounds like you already know how to do.

Thanks guys

That explains what happened and what I need to avoid.

I’m starting from a new SD card and this time I set the root password and also made another superuser account just in case.

Suggest rather do not enable the root account. Just create a second regular user. If you need to use the privileged account you can ‘su’ to it (this can be disabled) and then do the sudoing you need, however I find that 75% of times at least, sudo is used unnecessarily and you could do a user install. Pip, for example, supports --user install as well as to virtualenv. Installation from tarball can go anywhere as well.

For most things on the Ubuntu desktop that require it, you will be prompted for the sudo user’s password from an unprivileged one if it is needed (Software app, for example, will do this, Settings is another).

Please feel free to ask back here for advice if you want to avoid a sudo and do a user install of x thing instead. This will allow you to compartmentalize your users (one for one project, one for another) with minimal actual modifications to the underlying syste. If you mess up a user, simply delete the user and create a new one, keeping what you want. At least that is what I do.

(hit quote button rather than edit on mobile)