You are not logged in.

#1 2020-10-02 08:11:31

benedict_0
Member
Registered: 2019-11-08
Posts: 71

Have a new user inherit config from an existing user (network...)

Hi,

In order to compartimentalize personal life and work, I am creating a second user on my computer.

When I logged in with the new user, it seemed a bit... empty! The wifi, for instance, was not set up. How could I make the new user "inherit" useful config from the existing user. My authentification is through a tunneled TLS so it's a pain in the ass, and not exactly as simple as typing a password once.

Is there a smart way to do that?

Offline

#2 2020-10-02 09:06:43

solskog
Member
Registered: 2020-09-05
Posts: 462

Re: Have a new user inherit config from an existing user (network...)

Another approch is to share DISPLAY, XAUTHORITY and XDG_RUNTIME_DIR environment variables for multi-user accounts.

1, user1 is a privileged user.
$ cat /etc/sudoers
user1 ALL= (ALL) NOPASSWD: ALL
2, From a Display Manager in Xorg, login as user1, open a urxvt and type
$ chmod go=x /home/user1
$ chmod go=r /home/user1/.Xauthority 
$ exec su --pty --login user2
3, Now you are a child process of user1 but logged in as user2, then type
$ env -S DISPLAY=:0 XAUTHORITY=/home/user1/.Xauthority XDG_RUNTIME_DIR=seat1 setsid --fork urxvt
4, Now you are a detached process from user1
systemd(1)-+-dbus-daemon(366,dbus)
           |-login(413)---startx(436,user1)---xinit(475)-+-twm(482)
           |                                              `-Xorg(476)-+-{Xorg}(477)
           |-urxvt(599,user1)---bash(600)
           |-urxvt(1222,user2)---bash(1223)
5, And from now on you can start any program and access any file as two different users, but within the same Xorg login session.

For a more safer setup, you should create a separate user for Xorg login as well.

Last edited by solskog (2020-10-02 10:56:43)

Offline

#3 2020-10-05 09:37:48

benedict_0
Member
Registered: 2019-11-08
Posts: 71

Re: Have a new user inherit config from an existing user (network...)

Thank you solskog. I fear it is overkill for what I want to achieve.

Offline

#4 2020-10-05 09:45:04

progandy
Member
Registered: 2012-05-17
Posts: 5,321

Re: Have a new user inherit config from an existing user (network...)

If you use networkmanager to set up your connections, there may be an option called "All users can connect" or something like that. You may also have to change some stuff in the connection file in /etc/NetworkManager/system-connections

If you use something else to connect, what is it?

Last edited by progandy (2020-10-05 09:46:47)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' | alias ENGLISH='LANG=C.UTF-8 ' |

Offline

#5 2020-10-06 10:04:46

benedict_0
Member
Registered: 2019-11-08
Posts: 71

Re: Have a new user inherit config from an existing user (network...)

progandy wrote:

If you use networkmanager to set up your connections, there may be an option called "All users can connect" or something like that. You may also have to change some stuff in the connection file in /etc/NetworkManager/system-connections

Thank you, that works for a simple wifi connection so it is useful at home.

If you use something else to connect, what is it?

It is eduroam: https://www.eduroam.org/

Offline

#6 2020-10-06 11:05:10

solskog
Member
Registered: 2020-09-05
Posts: 462

Re: Have a new user inherit config from an existing user (network...)

arch wiki NetworkManager wrote:

Connection 'eduroam' is not avialable on device wlan0 because profile is not compatible with device (802.1x connections must have IWD provisioning files)
This is because NetworkManager can not configure a WPA Enterprise network. Therefore you have to configure it using an iwd config file /var/lib/iwd/essid.8021x like described in
https://wiki.archlinux.org/index.php/Iwd#WPA_Enterprise

Offline

Board footer

Powered by FluxBB