How to set user ID to 1000 (instead of 1001)

Warning: Doing this implies that you understand that changing things as root (system administrator) means that you understand what you are doing. Also that you have some ability to deal with problems should any occur. Should you encounter difficulty post your issue in forum with a descriptive title and enough accurate information so someone can help. For serious technical issues file a bug report. For faster response user should use OpenMandriva Chat.

Now for the procedure:

For user that believes they would be better served with UID/GID of 1000 this is a proposed work around. I have tested this on hardware PC’s and in VBox and in seems to work OK. I see no effect on how I use shared folder in VBox for instance.

Hypothetical user name user. Where you see user in commands change that to your actual user name.

After installation boot to console mode. Login as root. (This also works on an existing system in test situation.)

# usermod -u 1000 user

# groupmod -g 1008 lusers

# groupmod -g 1000 user

# exit

$ sudo chown -R user:user $HOME

Reboot.

To check our work

Check ownership of folders in /home/user:

$ ls -l /home/user

Check UID of user:

$ id -u user

Check GID of:

$ id -g user

What we have done:

Changed UID and GID of user user to 1000. Changed GID of luser 1008.

Set user and group ownership of everything in /home/user to user.

No password or permissions were changed.

Works just fine in test situations. Tested on hardware PC’s and in VBox VM’s. Nothing changed as far as how shared folder works in VBox that I have seen so far.

1 Like

I suspect for a lot of uses changing the GID really won’t matter which would simplify this.

# usermod -u 1000 user

# exit

$ sudo chown -R user $HOME

To check our work

Check ownership of folders in /home/user:

$ ls -l /home/user

Check UID of user:

$ id -u user

What we have done:

Changed UID of user user to 1000.

Set ownership of everything in /home/user to user.

No password or permissions were changed.

1 Like