Posted by: terryhowe | March 10, 2017

Rename user in Ubuntu

I recently fired up a new ubuntu 16.04 instance on some new hardware, installed a bunch of software and configured various preferences only to discover that I had a typo in my user name.  In order to fix this problem, I created a new user bob and gave bob sudo privileges. I logged in as bob and ran sudo -i and executed the following commands:

usermod -l terry terr7y
groupmod -n terry terr7y
usermod -d /home/terry -m terry

When I logged back in as terry everything was working as expected.

That all worked great, but I had to completely destroy my virtualenv and tox directories.  From my home directory I ran:

grep -rl terr7y .

This command revealed some configurations that had my user name hard coded.



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s


%d bloggers like this: