1

I'm trying to upgrade to 14.04, but one hard issue prevents me from doing that, I'm sticking to Lucid until end-of-support.

I read this How can I change my own user ID?
but apparently on my Ubuntu 14.04 it's do not work.

If I try to change UID/GID for an existing user, either by command line (usermod etc.) or by system > users and groups > advanced settings I end up in a cul-de-sac situation: the user exists on the sustem, UID and GID are the ones I set, I can login using ssh, file ownership ore OK ... but I cannot login from the Unity/XFCE GUI.

The modified user just "disappears" from the user list, it also disappears from system > users and groups.

Of course the user is there, but somehow it is crippled.

Thanks,

1 Answers1

1

The logic simple like a charm. A good word usermod can make your day if you're clever enough and do not stop with each your cul-de-sac ...

Need to say each solution about changing the user's security you must decide individually due to the universal solution do not exist.

And yes, this can looks like a bug.

Ok, read Ubuntu Manpages for usermod to define the parameter for changing UID:

-u, --uid UID

The new numerical value of the user's ID.

This value must be unique, unless the -o option is used. The value must be non-negative.

The user's mailbox, and any files which the user owns and which are located in the user's home directory will have the file user ID changed automatically.

The ownership of files outside of the user's home directory must be fixed manually.

No checks will be performed with regard to the UID_MIN, UID_MAX,
SYS_UID_MIN, or SYS_UID_MAX from /etc/login.defs.

Also cul-de-sac:

CAVEATS

You must make certain that the named user is not executing any processes when this command is being executed if the user's numerical user ID, the user's name, or the user's home directory is being changed.

usermod checks this on Linux, but only check if the user is logged in according to utmp on other architectures.

You must change the owner of any crontab files or at jobs manually.

You must make any changes involving NIS on the NIS server.

Also read about groupmod.

Sure, if you need repair your "nevertheless" you must at least fix ownership for files and directories outside your HOME folder lookalike:

sudo chown -R username /path/to/directory

Best wishes,

swift
  • 3,291