Change username

How can I change the name of my default user?
I’ve tried using usermod both as the regular account and as a new account I created but neither worked
The second account I created said it wasnt in the sudoers list even after manually adding it to /etc/sudoers

bumping this. I tried usermod too, but it says my user is running a process.

this seems simple enough for a developer to test and document for us. :slight_smile:

Untested - but it’s standard linux stuff, there shouldn’t be anything specific to Qubes Os: create a temporary user that has sudo rights, reboot, at the graphical login switch to a virtual console (eg ctrl-alt-f2), login as the temporary user you’ve just created, sudo, usermod / rename homedir / change whatever you like, then switch back to graphical login (ctrl-alt-f1) and log in with your new account.

You may do without a temporary user by setting a password for root and logging in as root in the console. You may also do without a reboot by killing remaining user processes while logged in in the console - eg pkill -9 -u youroldusername. A quick web search shows plenty of those instructions.

Expect some breakage as some programs hardcode the homedir path; grep -r '/home/yourusername' /home/yourusername will reveal the offenders. On my installation those are a bunch of menu entries (qubes appmenus) and some XFCE stuff. Recreating the qubes menus should fix the former, the latter would have to be edited by hand. But a simple alternative is to create a symlink of /home/user to your new homedir.

YMMV of course. If you’re not feeling experienced enough to recover from a broken system, do backups and be on the safe side.

In case you try those instructions, please contribute back and document how it went for other users :slight_smile:

1 Like

I did exactly this:
pkill -9 -u youroldusername

and I am now stuck with an unresponsive admin user account as described seeking help here:

How do I re-enable all processes for an user???

Thank you btw :slight_smile:

The closest thing I found so far is this:

However while some of those commands work in Qubes, most of the commands listed don’t seem to work

e.g. This works:
sudo ls /proc

e.g. These doesn’t seem to work:

sudo cd /proc

and :point_down:t3:

sudo cd /proc/PID

(maybe Qubes has a different command than this Linux distro being cited)

Even so, how am I supposed to go one by one re-enabling every process for the user when I am a complete n00b to Qubes so I have no idea all the processes associated that was killed when executing the pkill -9 -u on my main admin user

Please help