I accidently changed my root user's name and now have lost all root permissions

I was messing around on my minecraft server with usermod and at some point I copied a command from a forum with incorrect terms.

now when I sudo cat /etc/passwd,

the output for my root user is as follows

2r(M@kRf5N#u2DW2root:x:0:0:root:/root:/bin/bash

with the string in front of the user being my password for the server.

This error has left me being unable to even cd most directories even as im the owner.

As for how the server is setup, im using vultr one click minecraft server

because of this I am still able to access the server through ssh.

Asked By: Aye Chan Maung

||

Since you can do sudo cat /etc/passwd you should also be able to open and edit the passwordfile: ex: sudo nano /etc/passwd and then remove the extra chars before root.

Maybe make a backup of passwd before starting editing it.

Answered By: Soren A