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. To fix this, log out completely by clicking the power icon in the top-right corner and selecting Log Out. Once you’re back at the login screen, switch to a TTY session by pressing Ctrl + Alt + F3, where you can safely perform the username change.
sudo passwd -S root
This shows the status of the root account. If it’s locked, you won’t be able to log in as root yet.
sudo passwd root
If the root account is locked (status shows L), you can unlock it by setting a new password.
ps -u old_username
Before renaming a user, make sure the old user isn't running any processes.
usermod -l new_username old_username
This changes the username from old_username to new_username.
cat /etc/passwd | grep new_username
Check /etc/passwd to confirm that the user has been renamed successfully.
usermod -d /home/new_username -m new_username
This command updates the user’s home directory to match the new username and moves all existing files to the new location. After completing the changes, return to the graphical interface by pressing Ctrl + Alt + F1 or Ctrl + Alt + F2.
Fixing File Manager
After changing the username, you might notice broken bookmarks in the Nautilus file manager. To fix them, locate and edit the bookmarks file, then update all paths that still point to the old home directory so they match the new username.
find ~/.config -name "*bookmarks*" -type f 2>/dev/null
This searches for any files in your ~/.config directory that contain “bookmarks” in their name. The 2>/dev/null part hides any “permission denied” errors.
nano ~/.config/gtk-3.0/bookmarks
Use a text editor (here, nano) to open the bookmarks file.
Inside the file, change all instances of the old home directory path (/home/old_username) to the new one (/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)