Error editing user in Yast

Recent time got errors editing user in Yast: after any change (for example add/remove group to a user) got error: can’t change owner /home/user:

While changes looks saved, however not sure they are applied (for example groups). Where could be the problem?

For groups, they are configured in /etc/group.
And in the same file you can see if users are added to a group.

For the primary group of a user check the user’s entry in /etc/passwd. E.g. for user mgi:

henk@boven:~> grep mgi /etc/passwd
mgi:x:1002:100:Machine Generated Information:/home/mgi:/bin/bash
henk@boven:~>

The primary GID is the fourth field, in this case 100. Now

henk@boven:~> grep :100: /etc/group
users:x:100:
henk@boven:~> 

shows the Goup Name users of the primary group of user mgi.

As this is the English part of the forums, most people will not be able to understand what the image says.

Yep, switched to English locale now:

Added.

# grep :100: /etc/group
users:x:100:aleksey

# grep aleksey /etc/passwd
aleksey:x:1000:1000:Aleksey:/home/aleksey:/bin/bash

So, it seems that changes have been applied. Anyway, I think it would be good if this error was gone.

Check ll /home/ |grep aleksey

> ll /home/ |grep aleksey
drwxr-xr-x 1 aleksey aleksey 2188 фев  9 17:38 aleksey

That is the WRONG way around. The last command shows that alekseys primary group is 1000. Thus you then should have done

grep :1000: /etc/group

to get the name of the primary group of aleksey.

This shows that aleksey is also member of group users

And this shows that, most probably, the primary group of aleksey is aleksey (with GID 1000`). same names, but two different entities.

So, what does it mean?

That is up to you. You said you were not sure if your actions were really implemented. Thus I showed you the places (files) where you can find what is the present situation. If that is in line with what you wanted and did can only you know.

But to recap what was found:

  • user aleksey (UID=1000) is configured with primary group aleksey (GID=1000);
  • user aleksey is also a member of group users (GID=100).

If you have other users where you want to know what their primary group is and of which other groups they are also a member, you now know how to check that.
You can also look direct in /etc/groupto see what groups exist and what users are added to them.
You can also look in /etc/passwd to see what the primary group of each user is.

Something different is of course still the error you got. We did not tackle that until now.

@hcvv remember the group users (100) is not used in Tumbleweed anymore when creating users… the username passwd entry should be username:1000:1000...

Example;

useradd -m testuser

cat /etc/group | grep testuser
testuser:!:1001:

cat /etc/passwd | grep testuser
testuser:x:1001:1001::/home/testuser:/bin/bash

@akontsevich you should look at using Cockpit anyway…

I am only explaining to the OP what he has and how he can “see” what he has.

What you show might be the default on new installations. I doubt that on a long time existing Tumbleweed installation an upgrade will complete overthrow the existing user/group configuration.
But I do not use TW, thus you may enlighten me.

This is probably the cause - old TW installation - will try to remove it and see if the error is gone.

What is it and why to use it?

No, it does not - at least it did not on my system which was installed 4 years ago.

Removed users group from aleksey, then removed the group. Now got another error on any user parameter change and even if I do not change anything:

@akontsevich because YaST is deprecated, Cockpit is the new management tool…
https://en.opensuse.org/Main:Cockpit

And when you have then the old situation and also are not really affluent with user/group management and then add a new user, you will be confused.

IMO changing defaults is so horrible :frowning: . Most people are not aware of all the defaults they use. And when then the default changes: Panic.

@hcvv Since your not using Tumbleweed, please be careful when offering advice at a system level if you don’t understand the changes are being/have made.

1 Like

Now again have initial error:

I see, however I do not like web interface and used to Yast a lot. Good to make it working.

It is really unclear what you mean here or what you did. When you want any comment, then SHOW the relevant entries in /etc/passwd and /etc/group.
And also do not forget that when you change the primary group of a user, you should also change the group ownership of all his files (most of them, when not all will be in /home/aleksey and also /home/aleksey itself must be changed).

It is also unclear why you are doing these things. Remember that it is better to explain what your goal is then just telling us that a particular step is acting unexpected.