I have kubuntu 16.04 running. I wanted to setup a permanent mount to my synology NAS and following their tutorial I adapted my userid to the one on the synology.
I created a new user on my machine with sudo rights and typed the following:
sudo usermod -u 1026 -g 100 myoldlogin
So my new user can login via Plasma, the new and old user can login via terminal, but my old user cannot login anymore via Plasma GUI.
My olduser now really has the userid 1026.
What went wrong, how can I fix this?
First of all, group IDs (GID) below 1000 are used by the system and other no-login groups and usually not as primary group for normal user accounts. You should give your user a GID above 1000, ideally the same number as its user ID (UID).
Second, file system ownership is bound to user/group IDs, not names. Therefore changing your account's UID and GID will make it lose all rights on files it owned before.
This means you have to reassign the ownership of that account's home directory to the new UID/GID pair. The most important file here is probably the
~/.Xauthority
file. If that one is not owned by the correct user, it will not be able to log into the graphical desktop.You recursively change the ownership of a directory with this command:
Simply replace
USER
andGROUP
with the respective name or ID and use your old user's home directory (e.g./home/myoldlogin
) asDIRECTORY
. The command you have to run could then look like this: