Score:4

su: user does not exist or the user entry does not contain all the required fields

lk flag
R B

In Ubuntu Studio 22.04 LTS I usually log in as a non-privileged domain user. If I need to perform an administrative task (in a terminal window), I have previously used "su" to change to a local or domain administrator account. This no longer works. Instead, "su" yields the error message:

su: user <user_name> does not exist or the user entry does not contain all the required fields

Something else which has changed and may be related, is that my domain user name in the terminal window prompt now appears as:

<domain_user>@<domain>@<computer_name>

This used to appear as:

<domain_user>@<domain>

I am not aware of having done any thing to cause this change. In view of this, I have tried all of the following "su" commands, but they all yield the same error message:

su <local_admin>
su <domain_admin>@<domain>
su <domain_admin>@<domain>@<computer_name>

whoami yields <domain_user>@<domain> (which is also how I log in). grep <local_admin> /etc/passwd and getent <local_admin> both produce the expected output:

<local_admin>:x:1000:1000:<local_admin>:/home/<local_admin>:/bin/bash

sudo -iu <local_admin> prompts me for a sudo password for my current logged in user, <domain_user>@<domain>, which is unprivileged and therefore does not have a sudo password.

Network shares of domain users are still being mapped and access permitted correctly.

Any clues as to what is wrong or how to identify the cause of the problem would be most welcome!

terdon avatar
cn flag
What is the output of `whoami` and `grep local_admin /etc/passwd`? That should help you understand what the "real" user name is. Is it any different if you try `sudo -iu local_admin` instead (I really doubt it, but you never know)?
R B avatar
lk flag
R B
Thanks for the tips. whoami yields <domain_user>@<domain> (which is also how I log in.
R B avatar
lk flag
R B
@terdon Thanks for the tips. whoami yields <domain_user>@<domain> (which is also how I log in). grep <local_admin> /etc/passwd produces the expected output: <local_admin>:x:1000:1000:<local_admin>:/home/<local_admin>:/bin/bash sudo -iu local_admin prompts me for a sudo password for my current logged in user, <domain_user>@<domain>, which is unprivileged and therefore does not have a sudo password.
R B avatar
lk flag
R B
@terdon As expected, getent passwd <local_admin> yields the same output as grep <local_admin> /etc/passwd I cannot imagine the kind of mismatch you describe. Network shares of domain users are still being mapped and access permitted correctly.
hr flag
The only other suggestions I can offer are (i) check /var/log/auth.log for errors related to `su` and/or `pam` and (ii) have someone who does have local administrator privileges run `pwck -r` in case it's some kind of shadow error
Score:1
lk flag
R B

Mysteriously, everything is working normally again. I can now su with both:

su <local_admin>
su <domain_admin>@<domain>

I am not aware of having changed anything, other than installing updates regularly. Presumably something was broken and then repaired during the regular updates.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.