Applying new user/group permissions in VNC session

Issues related to applications and software problems
Post Reply
yildizabdullah
Posts: 13
Joined: 2023/09/08 16:00:39

Applying new user/group permissions in VNC session

Post by yildizabdullah » 2024/01/30 07:06:04

I noticed that when the user and group permissions of a certain user are updated, the new settings do not apply for the current VNC session. Hence, it is required to restart the VNC session.

Is there a way to apply the new settings without restarting the VNC session?

User avatar
jlehtone
Posts: 4532
Joined: 2007/12/11 08:17:33
Location: Finland

Re: Applying new user/group permissions in VNC session

Post by jlehtone » 2024/01/30 13:36:10

What do you mean by "user and group permissions of a certain user are updated"?

yildizabdullah
Posts: 13
Joined: 2023/09/08 16:00:39

Re: Applying new user/group permissions in VNC session

Post by yildizabdullah » 2024/01/30 14:29:13

Hi,

I encountered this issue when I used usermod command to add a user to an existing group.

User avatar
jlehtone
Posts: 4532
Joined: 2007/12/11 08:17:33
Location: Finland

Re: Applying new user/group permissions in VNC session

Post by jlehtone » 2024/01/30 15:50:26

I still have to guess that you mean adding/removing user to groups.

When you log in, the authentication process creates a list of groups that your account is member of.
That list is passed to every process that is started during the session. In other words, the memberships
are not checked from source all the time.

The easiest solution is to log out and then login; create new session, where updated list is in use.

However, there is command newgrp that you can run. It will start a new bash (in that terminal),
where the group (given as parameter to the command) will not only be added to the list of groups,
but also is set as the primary group (for that bash process and commands run from it).

User avatar
TrevorH
Site Admin
Posts: 33224
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Applying new user/group permissions in VNC session

Post by TrevorH » 2024/01/30 16:10:42

But newgrp will only affect the single bash prompt in your VNC session that you run it in. It will not do that for the rest of the things running under VNC on that desktop. To do that you have to logout and back in again.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

User avatar
jlehtone
Posts: 4532
Joined: 2007/12/11 08:17:33
Location: Finland

Re: Applying new user/group permissions in VNC session

Post by jlehtone » 2024/01/31 10:01:16

True. While one can start some GUI applications, like editors, browser, and nautilus from bash, that does not cover everything.


Furthermore, lets say you have:

Code: Select all

$ id
uid=1000(jane) gid=1000(jane) groups=1000(jane)
and you create files:

Code: Select all

$ touch foo
$ ls -l foo
-rw-rw-r--. 1 jane jane 0 31. 1. 11:55 foo
Then you do newgrp work that creates a session:

Code: Select all

$ id
uid=1000(jane) gid=1001(work) groups=1001(work),1000(jane)
where:

Code: Select all

$ touch bar
$ ls -l bar
-rw-rw-r--. 1 jane work 0 31. 1. 11:55 bar
It may, or may not be desirable that the gid of the created files is 'work' in that shell and not 'jane' as if you had logged in again.


Overall, the "change of permissions" shouldn't be a frequent event, should it?

yildizabdullah
Posts: 13
Joined: 2023/09/08 16:00:39

Re: Applying new user/group permissions in VNC session

Post by yildizabdullah » 2024/01/31 10:25:12

Hi all,

Thank you for your clarification.

As I understand, every process that a user runs over VNC inherits the permission set when the VNC session is started. That is why permissions of a process are not updated while the VNC process is up and running.

Post Reply