DEV Community

Cover image for From whoami to "Who Am I?": My Journey as a Renamed Linux User
Adam Johnson
Adam Johnson

Posted on

From whoami to "Who Am I?": My Journey as a Renamed Linux User

🐧 It All Started With My First Linux Install

I typed a username without thinking much about it. For weeks, I knew I wanted to change it both for comfort and to learn how Linux manages users.

πŸ”§ Renaming a User on Fedora Workstation 42

You can't rename a logged-in user because system processes are running under that username. Here's what worked:

  1. Log out completely by clicking the power icon in the top-right corner, then select log out.
  2. At the login screen, switch to TTY (Ctrl+Alt+F3).
  3. Login as root (you might need to enable root first): sudo passwd -S root if it shows root L ... then unlock it by setting new password sudo passwd root
  4. Verify the old user isn't running any processes: ps -u old_username
  5. Rename the user: usermod -l new_username old_username
  6. Verify the change: cat /etc/passwd | grep new_username
  7. Update the home directory path: usermod -d /home/new_username -m new_username
  8. Return to the GUI (Ctrl+Alt+F1/F2).

πŸ—‚ Fixing File Manager

After changing username, I found broken bookmarks in Nautilus file manager. Here's how I fixed them:

  1. Find the bookmarks file: find ~/.config -name "*bookmarks*" -type f 2>/dev/null
  2. Edit it: nano ~/.config/gtk-3.0/bookmarks
  3. Updated all paths from /home/old_username to /home/new_username.

πŸ’‘ Key Takeaways

  • Linux user management involves multiple files and processes.
  • The terminal becomes much more enjoyable when you love your username!πŸ˜„

Top comments (0)