1

So, I have a little server colocated a few thousand miles away. I changed the username of my user account using vipw.

However, I did not realize that the UID did not carry sudoers privilege.

Now, I have no way of running any commands that require root access. I can't change my username because there is only one account on the system you can't change the username of an active account with usermod and I have no way of running vipw.

All I need to do is change the username back to what it was before, and I should be good to go.

Any ideas on how to do this?

Thanks.

Please no lectures. In all my years of running servers, I have never had a set-up quite like this particular server and I missed what should have been obvious.

1

Some possibilities I can think of:

  • Restore a backup of /etc/passwd, assuming you have some automated process to do it.
  • Have someone boot the server from a cd/USB stick and change it back.
  • Have someone mail the hdd to you.

I don't think you can do it from inside, without root. Would make sudo pretty useless otherwise.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.