0

I am using ubuntu server. My root account uid got changed to 0 to 1, i am not sure when and how. Becausse of this i cant execute any sudo commands on this server. This is what rroot account looks like in /etc/passwd

root:x:1:0:root:/root:/bin/bash

now im in root but i cant do any thing, its behaving like normal user root@server40:/var/log$ id uid=1(root) gid=0(root) groups=0(root)

Please advice me how i can change my root uid 1 to 0. This is production env, so please advice how i can procedd with this. I can get max downtime for 15 min.

Regards, Raj

raj
  • 1

1 Answers1

0

Boot from live disk, mount the / (root) partition, edit /etc/passwd (and probably /etc/shadow), save the file and reboot

P.S. And check if there is no other account with ID 0 (which may be indicator of hacked machine)

Romeo Ninov
  • 7,848