Changing username?

Hi there, maybe this isn’t the right place but I didn’t find one more suitable…
Is it possible to change the username without losing all my stuff (which is not so much so far anyway…)?
Many thanks in advance.
Marco

1 Like

To change user login mappings, you can use ‘usermod’:
‘usermod -l <new-name> <current-name>’

You may also wish to rename your default group:
‘groupmod -n <new-name> <current-name>’

This will not rename your home folder. You would need to do that manually.
You could rename it, then make sure the mappings are correct, by using ‘usermod’, or by directly editing /etc/passwd.
The better way might be to use ‘usermod -d <new-home> -m <username>’ which should create a new home folder and move everything too it. This reduces the chance of getting something wrong.
You may have to delete the old home directory afterwards, and this may break anything that was, for any reason, hard-coded to use your old path, but that shouldn’t normally happen.

I recommend logging in as root when you do this.
Things may throw a fit if you change your username or home directory while you’re logged in.

2 Likes

Could you please clarify what username you are referring to? The answer given assumes you are trying to change the username on your computer, but I’d like to double-check if you’re asking how you could change your username on the forum?

2 Likes

OMG, this is so embarrassing… @cptgraywolf: please apologize, it was not my intention to change my system’ user name, thanks a lot for your detailed instructions.
@ankursinha: yes, my question is about my username on the forum.
Sorry

No worries, I thought it best to clarify :slight_smile:

I know your “display name” can be changed in your preferences, but your username is not so easy to change. Take a look at this thread please:

1 Like

Yeah, this is the way. Since it requires non-trivial manual work from site staff and the Fedora infrastructure team, I hope people don’t take it lightly — this shouldn’t be used for simple amusement. Thanks.

1 Like