Packetize Me No Packet Left Behind

Stop deadnaming me, Linux!

If you’ve changed your name for any reason, you’ll know that doing so can be an arduous process. I’m currently working through this myself and was getting tired of being greeted by my old name (deadname) every time I opened up my laptop. Here are my notes on addressing this; if you’re on Windows, MacOS, or anything other than Linux, these instructions aren’t likely to help. I followed this process on Fedora, but I believe it will be applicable on most other distributions. When in doubt, consult the man page for the command you’re about to run.

Updating your account

Log in as root, or a user other than your normal account which has the ability to execute usermod as root (e.g. via sudo). You’ll want to update your username while not actively using it; things might be OK, but they may not. Besides, if you’re going through this: do you want to log in as deadname again? I logged in as root from a console, opened via CTRL+ALT+F2, but you should be able to do this via your display manager.

Update your username

If you’re like me, you may have used your deadname as your username. Or maybe you’re adopting a new last name, and your old one was reflected in your username. Either way, you can easily change your logon name.

Replacing [name] with your desired username and [deadname] with the username that you previously used, execute the following as root:

usermod -l [name] -d /home/[name] -m [deadname]

Reboot for good measure; good riddance deadname!

Upon reboot, be greeted with your deadname. Shit.

Update your full name

Thanks for deadnaming me again, computer. It’s OK, I just forgot that changing my username wouldn’t update the full name associated with my account. Let’s do that now:

usermod -c "[Display Name]" [name]

Learn from my mistakes

Don’t be greeted by your deadname even one more time. Rather than using the previous two commands, combine them:

usermod -l [name] -c "[Display Name]" -d "/home/[name]" -m [deadname]

More headaches

If you relied on symlinks to /home/deadname, congratulations: you broke them. Let’s fix that.

You can use find to identify all of the symlinks in your home directory which point to your old (deadname) home directory. I tee’d this to a log so that I could review it easily:

find /home/[name] -lname '/home/[deadname]*' -ls

What to do from here? Honestly, I fixed these manually. I had a fairly small number of links to fix and, although I believe that it could be coerced into doing this for me, I’m unfamiliar with the finer points of find. Not liking the way I’m leaving this, and knowing that I will need to repeat this process for other systems, I intend to update this post when I come up with a proper solution. Sorry for leaving you hanging here.

Follow-up posts: