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,

15
  • It is a normal behavior ... No magic at all.
    – swift
    Jan 19, 2015 at 20:30
  • hah :-) if there's no way to change a user's UID, it's no magic at all. It's just a bug. Jan 19, 2015 at 21:46
  • No, @Ezio Ostorero. It is not a bug. If you try change UID you are not logged this UID. The bug yet it is your illusion about.
    – swift
    Jan 19, 2015 at 22:10
  • Hi swift. If an operating system configuration utility allows me to change a userd ID and this operation makes the user unusable, this is a bug, IMHO. In any case discussing the meaning or feeling of "bug" is a little OT in this forum. Question is: how do I change UID of an Ubuntu user and be able to log-in again whith this modified user? Jan 20, 2015 at 14:24
  • Ask this & also won't be useless: What is the normal reason for changing user ID?
    – swift
    Jan 20, 2015 at 23:58

1 Answer 1

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,

7
  • Sorry swift. But that does not work. No way. Read my first post: file ownership is OK (I used chown in the first place, along with any combination of usermod and userdel) and I can login with ssh. I CANNOT login from the Unity/XFCE login screen, the modified user disappears. Jan 24, 2015 at 13:50
  • @Ezio Ostorero, need more details. Login with available user and find what a problem. I do not think that it is hopeless. If your new user folder exists some permissions for group containing this user will be adequate.
    – swift
    Jan 24, 2015 at 17:27
  • re-read, updated
    – swift
    Jan 24, 2015 at 17:59
  • Here's the details. I need a user "foo" with UID=501 and GID=501. I can do that by command line:adduser foo --uid 501 --gid 501. So far so good, user "foo" shows up in /etc/passwd , home folder is /home/foo and files have appropriate ownership of user "foo", I can ssh-login with "foo"'s credentials, I'm happy. What I CANNOT do is login as user "foo" from the GUI (XFCE or Unity) screen, "foo" is not in the users list, there is no way to input "foo" as username in the login screen, as far as I know. Jan 25, 2015 at 16:28
  • More detials: I CANNOT create user "foo" using System->Users and Groups screen. As soon as I try to apply a UID different for the one proposed, the user disappears from the list, as it does from the login screen. Jan 25, 2015 at 16:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .