There is an option to have more than one user on your linux box and use them for different task. So, basically, I used it sometime to have different instance of application for different projects. For that, I normally add another user. The new user will have different uid and it could have different gid or something common between my users.
To make this post more readable, let me define some names that makes more sense. Suppose the main user name is Umain
, and the second one is Uclone
.
This time, I tried to create the Uclone
with the same id as Umain
. (I wanted to have everything the same and I didn't consider the consequences) So, I created the Uclone
by:
sudo useradd Uclone -m -N -o -g 1000 -u 1000
The userid and group id of Umain
are 1000, and I tried to create the clone of my user with above command to assign the same userid and groupid to Uclone
.
Everything was fine, until I restart my system. I can't login to Umain
anymore and the Uclone
is the one that is available in the login page. The Umain
exist in the /etc/passwd
, however, I can not login to gdm or kdm with Umain
user anymore.
I tried to remove the Uclone
but I couldn't. It always replied that there is some process that are running by this user. So, I killed the process and it came back again. I just realized that as the userid are the same, now the system have to problem to recognize the Umain
and Uclone
. I tried to change the groupid of the Uclone
and I was successful. However, I can't change the userid of Umain
or Uclone
since I get below response.
$ sudo usermod Uclone -u 1010
[sudo] password for AnotherUser:
usermod: user Uclone is currently used by process pid
So, I am wondering what options I have to fix my system. I think the last hope would be using rescue mode, but I think there should be more easier way to handle this. I appreciate if you can help me to resolve this problem.
Side note: I am using Ubuntu 14.04.