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,

  • It is a normal behavior ... No magic at all. – swift Jan 19 '15 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. – Ezio Ostorero Jan 19 '15 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 '15 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? – Ezio Ostorero Jan 20 '15 at 14:24
  • The main reason is to be interoperable with shared filesystems, preserve ownership, permission and protections across systems, that is, being interconnected. Now I have another question: what is the reason for not allowing to change user ID which is a useful and time-honored function, supported by all Unix-like systems? – Ezio Ostorero Jan 21 '15 at 08:51
  • Tatsächlich!? @Ezio Ostorero, Ask These Questions – swift Jan 21 '15 at 18:02
  • Yes swift. What you wrote here ( http://askubuntu.com/questions/575970/what-is-the-normal-reason-for-changing-user-id ) is correct, ant what is shown is exactly the user/group management screen I'm using to change UID/GID. We're on the same page. But, as I said at the very beginning, this operation renders the modified user useless. How do we get out of there? Ciao,and thanks for your patience. Ezio – Ezio Ostorero Jan 21 '15 at 19:18
  • Just ask yourself: What is a modified user? I believe: it is an user grouped into other groups which have other rights and the system objectively renders(really do not) such accounts. It is more than enough for. The Bug, will be named if the system "will be incorrectly render the user which do should not be rendered". – swift Jan 22 '15 at 04:03
  • I try to answer, questions are a little cryptic, though :-) – Ezio Ostorero Jan 22 '15 at 09:02
  • OK, a modified user can be many things, in our case is a user that is grouped differently, i.e. I want it to belong to a different set of groups that is a VALID set. The system should have no objections to this reconfigurations, it's been like that since the beginning of time. There is no reason why the modified user should not be rendered. If, as you say, the system incorrectly renders the correctly modified user, then, the system is bugged. – Ezio Ostorero Jan 22 '15 at 09:12
  • Sorry, in the post above I said changing group. The problem is actually changing the UID, but the result is the same. – Ezio Ostorero Jan 22 '15 at 16:49
  • the titular system safety is not about buggy user comfort. and even some perfect user do not impersonate the titular safety. – swift Jan 23 '15 at 00:07
  • I've been working in Japan for quite a while, I love Zen philosophy and Haiku poetry. But we're talking technology here, no perceptions, comfort, feelings. Bottom line is, changing UID is acceptable, the system safety is comfortable with it, so, why not on Ubuntu? – Ezio Ostorero Jan 23 '15 at 13:23
  • answer for you found – swift Jan 24 '15 at 04:14

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,281
  • 2
  • 23
  • 46
  • 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. – Ezio Ostorero Jan 24 '15 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 '15 at 17:27
  • re-read, updated – swift Jan 24 '15 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. – Ezio Ostorero Jan 25 '15 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. – Ezio Ostorero Jan 25 '15 at 16:29
  • under Ubuntu the values available for creating user's IDs starts from 1000(1001) due to the values from 0 to 999 system reserved. – swift Jan 25 '15 at 16:37
  • Ouch! This is new to me, I've been using UID < 1000 for ages, in order to be Mac and Unix compatible. Thanks anyway. – Ezio Ostorero Jan 28 '15 at 14:43