Changing all of /home/user contents group ownership?

Hi, I am trying to change the /home/paul directory and all of it’s subfolders and symlinks group ownership (it’s currently paul : users) to paul : paul.

Thinkcentre-M57p:/home> ls -lah
total 0
dr-xr-xr-x 1 root root   14 Jan 21 18:18 .
drwxr-xr-x 1 root root  142 Jun  3  2021 ..
drwx------ 1 deb  deb   318 Jan 21 15:12 deb
drwxr-xr-x 1 paul users 868 Jan 21 21:04 paul
Thinkcentre-M57p:/home> id -a
uid=1000(paul) gid=1000(paul) groups=1000(paul),488(cdrom),489(audio)
Thinkcentre-M57p:/home> groups paul
paul : paul audio cdrom
Thinkcentre-M57p:/home>

I have tried the following with no joy.

Thinkcentre-M57p:/home> sudo chgrp -LR users paul
[sudo] password for root: 
chgrp: cannot dereference 'paul/.local/share/Steam/ubuntu12_32/steam-runtime/amd64/usr/lib/i386-linux-gnu/libstdc++.so.6': No such file or directory
chgrp: cannot dereference 'paul/.local/share/Steam/ubuntu12_32/steam-runtime/amd64/usr/lib/x86_64-linux-gnu/libstdc++.so.6': No such file or directory
chgrp: cannot dereference 'paul/.local/share/Steam/ubuntu12_32/steam-runtime/amd64/selinux': No such file or directory
chgrp: cannot dereference 'paul/.local/share/Steam/ubuntu12_32/steam-runtime/i386/usr/lib/i386-linux-gnu/libstdc++.so.6': No such file or directory
chgrp: cannot dereference 'paul/.local/share/Steam/ubuntu12_32/steam-runtime/i386/usr/lib/x86_64-linux-gnu/libstdc++.so.6': No such file or directory
chgrp: cannot dereference 'paul/.local/share/Steam/ubuntu12_32/steam-runtime/i386/selinux': No such file or directory
chgrp: cannot dereference 'paul/.local/share/Steam/ubuntu12_32/steam-runtime/usr/lib/i386-linux-gnu/libstdc++.so.6': No such file or directory
chgrp: cannot dereference 'paul/.local/share/Steam/ubuntu12_32/steam-runtime/usr/lib/x86_64-linux-gnu/libstdc++.so.6': No such file or directory
chgrp: cannot dereference 'paul/.local/share/torbrowser/tbb/x86_64/tor-browser/Browser/.config/ibus/bus': No such file or directory
chgrp: cannot dereference 'paul/.mozilla/firefox/5y2y5y4i.default-release/lock': No such file or directory
chgrp: cannot dereference 'paul/.steam/bin32/steam-runtime/amd64/usr/lib/i386-linux-gnu/libstdc++.so.6': No such file or directory
chgrp: cannot dereference 'paul/.steam/bin32/steam-runtime/amd64/usr/lib/x86_64-linux-gnu/libstdc++.so.6': No such file or directory
chgrp: cannot dereference 'paul/.steam/bin32/steam-runtime/amd64/selinux': No such file or directory
chgrp: cannot dereference 'paul/.steam/bin32/steam-runtime/i386/usr/lib/i386-linux-gnu/libstdc++.so.6': No such file or directory
chgrp: cannot dereference 'paul/.steam/bin32/steam-runtime/i386/usr/lib/x86_64-linux-gnu/libstdc++.so.6': No such file or directory
chgrp: cannot dereference 'paul/.steam/bin32/steam-runtime/i386/selinux': No such file or directory
chgrp: cannot dereference 'paul/.steam/bin32/steam-runtime/usr/lib/i386-linux-gnu/libstdc++.so.6': No such file or directory
chgrp: cannot dereference 'paul/.steam/bin32/steam-runtime/usr/lib/x86_64-linux-gnu/libstdc++.so.6': No such file or directory
chgrp: cannot dereference 'paul/.steam/root/ubuntu12_32/steam-runtime/amd64/usr/lib/i386-linux-gnu/libstdc++.so.6': No such file or directory
chgrp: cannot dereference 'paul/.steam/root/ubuntu12_32/steam-runtime/amd64/usr/lib/x86_64-linux-gnu/libstdc++.so.6': No such file or directory
chgrp: cannot dereference 'paul/.steam/root/ubuntu12_32/steam-runtime/amd64/selinux': No such file or directory
chgrp: cannot dereference 'paul/.steam/root/ubuntu12_32/steam-runtime/i386/usr/lib/i386-linux-gnu/libstdc++.so.6': No such file or directory
chgrp: cannot dereference 'paul/.steam/root/ubuntu12_32/steam-runtime/i386/usr/lib/x86_64-linux-gnu/libstdc++.so.6': No such file or directory
chgrp: cannot dereference 'paul/.steam/root/ubuntu12_32/steam-runtime/i386/selinux': No such file or directory
chgrp: cannot dereference 'paul/.steam/root/ubuntu12_32/steam-runtime/usr/lib/i386-linux-gnu/libstdc++.so.6': No such file or directory
chgrp: cannot dereference 'paul/.steam/root/ubuntu12_32/steam-runtime/usr/lib/x86_64-linux-gnu/libstdc++.so.6': No such file or directory
chgrp: cannot dereference 'paul/.steam/steam/ubuntu12_32/steam-runtime/amd64/usr/lib/i386-linux-gnu/libstdc++.so.6': No such file or directory
chgrp: cannot dereference 'paul/.steam/steam/ubuntu12_32/steam-runtime/amd64/usr/lib/x86_64-linux-gnu/libstdc++.so.6': No such file or directory
chgrp: cannot dereference 'paul/.steam/steam/ubuntu12_32/steam-runtime/amd64/selinux': No such file or directory
chgrp: cannot dereference 'paul/.steam/steam/ubuntu12_32/steam-runtime/i386/usr/lib/i386-linux-gnu/libstdc++.so.6': No such file or directory
chgrp: cannot dereference 'paul/.steam/steam/ubuntu12_32/steam-runtime/i386/usr/lib/x86_64-linux-gnu/libstdc++.so.6': No such file or directory
chgrp: cannot dereference 'paul/.steam/steam/ubuntu12_32/steam-runtime/i386/selinux': No such file or directory
chgrp: cannot dereference 'paul/.steam/steam/ubuntu12_32/steam-runtime/usr/lib/i386-linux-gnu/libstdc++.so.6': No such file or directory
chgrp: cannot dereference 'paul/.steam/steam/ubuntu12_32/steam-runtime/usr/lib/x86_64-linux-gnu/libstdc++.so.6': No such file or directory
chgrp: cannot dereference 'paul/.steam/bin/steam-runtime/amd64/usr/lib/i386-linux-gnu/libstdc++.so.6': No such file or directory
chgrp: cannot dereference 'paul/.steam/bin/steam-runtime/amd64/usr/lib/x86_64-linux-gnu/libstdc++.so.6': No such file or directory
chgrp: cannot dereference 'paul/.steam/bin/steam-runtime/amd64/selinux': No such file or directory
chgrp: cannot dereference 'paul/.steam/bin/steam-runtime/i386/usr/lib/i386-linux-gnu/libstdc++.so.6': No such file or directory
chgrp: cannot dereference 'paul/.steam/bin/steam-runtime/i386/usr/lib/x86_64-linux-gnu/libstdc++.so.6': No such file or directory
chgrp: cannot dereference 'paul/.steam/bin/steam-runtime/i386/selinux': No such file or directory
chgrp: cannot dereference 'paul/.steam/bin/steam-runtime/usr/lib/i386-linux-gnu/libstdc++.so.6': No such file or directory
chgrp: cannot dereference 'paul/.steam/bin/steam-runtime/usr/lib/x86_64-linux-gnu/libstdc++.so.6': No such file or directory
chgrp: cannot dereference 'paul/.steampath': No such file or directory
chgrp: cannot dereference 'paul/.thunderbird/3zm8yxv9.default-release/lock': No such file or directory
Thinkcentre-M57p:/home>
 Thinkcentre-M57p:/home # chgrp -LR paul users
chgrp: cannot access 'users': No such file or directory
paul-Thinkcentre-M57p:/home #

I’ve reviewed the man chgrp man page *1 and still cannot seem to resolve this somewhat simple task.

What is the correct way to do this?

Thanks

I’m not sure what you are trying to do here.

To just change everything in your home directory, you could use:

cd /home/paul
chgrp -R paul .

That should not require root, unless there are files there that you do not own.

You use “-L” (follow symbolic links). That’s probably a mistake.

I initially noticed that logging in as user deb . Could cd into /home/paul and examine the directory contents (i’ll fix the permissions next). In the mean time of seeing this, I see paul:users and I do not want that. I want paul:paul for /home/paul contents. There are symlinks left over by steam at some point. Most of the journals I have read speak of -R and then, man chgrp has:

The following options modify how a hierarchy is traversed when the -R option is also specified. If more than one is specified, only the final one takes effect.

   -H     if a command line argument is a symbolic link to a directory, traverse it

   -L     traverse every symbolic link to a directory encountered

   -P     do not traverse any symbolic links (default)

So when it’s saying “traverse” above, it’s meaning skip? So “-H” and “-L” are used in which cases?

Yes, I am looking to change all group ownership to paul in /home/paul and subdirectories.
Thanks for your help.

In my home directory, I have:

% ls -l media
lrwxrwxrwx 1 rickert users 18 Jan 21  2016 media -> /run/media/rickert

That’s to make it easier for me to remember the mount when my desktop mounts a CD or USB.

If I were to use:

chgrp -RL rickert .

then it would try to change the group of everything in “/run/media/rickert/media” (due to that “-L”).

Most of the time, this would generate an error, because that directory doesn’t usually exist unless I have mounted something. If I happen to have mounted a CD, that would generate error messages for the files on the CD since they are readonly.

1 Like
Thinkcentre-M57p:~> chgrp -R paul
chgrp: missing operand after ‘paul’
Try 'chgrp --help' for more information.
paul@paul-Thinkcentre-M57p:~> chgrp -R paul 100
chgrp: cannot access '100': No such file or directory
paul@paul-Thinkcentre-M57p:~>

So that is not a valid command.

Thinkcentre-M57p:~> pwd
/home/paul
Thinkcentre-M57p:~>

Also I am noticing a recent install on a laptop has by default paul:paul for home none of the paul:users situation.

This was also already discussed in the forum and it is to expect.
The first fresh user under tumbleweed gets the same groupname as his user name. Every other user will be part of the users group…

testname1:testname1
testname2:users
1 Like

If it’s now my main account with superuser right how can I persist to username:username ?
Here’s a screenshot of finally managing to remove user via YaST2 only to have two paul,paul group members now.


I could swear this user was the initial admin user when the os was setup on the machine. Can it be changed?

Now drwxr-xr-x 1 paul  100 878 Jan 21 21:52 paul
Thinkcentre-M57p:/home> pwd
/home
Thinkcentre-M57p:/home>

Then what happens if the second user doesn’t want to be part of the users group? Trying to remove users from pauls groups via YaST2 now changed group to identity of 100.

Hi,
Thinkcentre-M57p:~> chgrp paul -R /home/paul
seems to have done the trick. Why is it that second user creation is defaulting to user group?

Thinkcentre-M57p:/home> ls -lah
total 0
dr-xr-xr-x 1 root root  14 Jan 21 18:18 .
drwxr-xr-x 1 root root 142 Jun  3  2021 ..
drwx------ 1 paul paul 878 Jan 21 21:52 paul
Thinkcentre-M57p:/home>

-Best Wishes :cold_face:

1196265 – User accounts are created with the former usergroup model (opensuse.org)

1 Like

Thank you for this, I see more clearly in my mind now.

1196265 – User accounts are created with the former usergroup model