How to get to root after switched to new user without being in ubuntu's sudoers


This is frustrating when I added a new user, then su newuser, couldn't go back to root by all means. It says not in sudoers afterwards. I've no root password, neither able to login from putty, it said login as ubuntu which rejected key, but i can login as newuser into newuser account. I sent 3 emails to support, no response. Hope I can do something here since my website is down for days.

1 Answer

Try to fix the files by attaching the volume to another running instance. Basically, you stop the instance, detach the boot volume, attach the volume to the running instance, mount it to the OS, the fix the sudoers or /etc files. Then do the reverse. Also, you can attempt to connect to the Serial Console to fix the files.

profile picture
answered a year ago
profile picture
reviewed a year ago
  • Hi, serial console still requires user login, but how do I get into the root? Could I assign password to root user or access Sudoers file directly?

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions