Unix & Linux Stack Exchange
Q&A for users of Linux, FreeBSD and other Unix-like operating systems
Latest Questions
0
votes
1
answers
2828
views
Giving access to user-installed python distribution to another linux user
(I'm not sure exactly what SE site my question belongs, I hesitated between stackoverflow, serverfault and superuser. Feel free to give suggestions about this in the comments.) Here is my problem: I have two users on my linux computer, `bli` and `pquarato`. `bli` installed python3.6 locally (compili...
(I'm not sure exactly what SE site my question belongs, I hesitated between stackoverflow, serverfault and superuser. Feel free to give suggestions about this in the comments.)
Here is my problem:
I have two users on my linux computer,
bli
and pquarato
. bli
installed python3.6 locally (compiling from source with ./configure --prefix=${HOME}
). The binary is installed in /home/bli/bin
, pip3.6 installs things in /home/bli/.local/lib/python3.6/site-packages
. For instance, numpy is installed there:
(bli) $ pip3.6 install numpy
Requirement already satisfied: numpy in /home/bli/.local/lib/python3.6/site-packages
I want pquarato
to be able to use bli
's python installation. bli
did chmod -R a+rx
on /home/bli/bin
and /home/bli/.local
.
pquarato
can use bli
's python3.6 binary, but it is not able to import modules installed with pip3.6:
(pquarato) $ /home/bli/bin/python3.6 -c 'import numpy'
Traceback (most recent call last):
File "", line 1, in
ModuleNotFoundError: No module named 'numpy'
The above works without errors for bli
.
What else should I do?
-----
Note: I actually first ran into a problem when trying to get pquarato
to use programs such as ipython3:
(pquarato) $ /home/bli/.local/bin/ipython3
Traceback (most recent call last):
File "/home/bli/.local/bin/ipython3", line 6, in
from pkg_resources import load_entry_point
File "/home/bli/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3017, in
@_call_aside
File "/home/bli/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3003, in _call_aside
f(*args, **kwargs)
File "/home/bli/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3030, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/home/bli/lib/python3.6/site-packages/pkg_resources/__init__.py", line 659, in _build_master
ws.require(__requires__)
File "/home/bli/lib/python3.6/site-packages/pkg_resources/__init__.py", line 967, in require
needed = self.resolve(parse_requirements(requirements))
File "/home/bli/lib/python3.6/site-packages/pkg_resources/__init__.py", line 853, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'ipython==6.2.1' distribution was not found and is required by the application
I hope that the same solution will solve both the ModuleNotFoundError
and the above DistributionNotFound
issue.
bli
(239 rep)
Apr 4, 2018, 11:57 AM
• Last activity: Aug 6, 2025, 02:08 PM
0
votes
1
answers
33
views
Linux Enabled Services only Run After killing 'multi-user.target'
[![enter image description here][1]][1] [1]: https://i.sstatic.net/Dd9Mitv4.png I noticed that on my RHEL 7 server on GCP, my enabled services (such as the test.service) will only start if I kill the multi-user.target service using systemctl. Would there be any reason the multi-user.target would han...

ThanoojJ
(3 rep)
Jan 20, 2025, 11:01 PM
• Last activity: Jan 21, 2025, 06:06 AM
2
votes
1
answers
90
views
Adding custom search engines to Firefox system-wide
On multi-user Debian systems with `firefox-esr` 128 I'd like to add search engines to the firefox search bar eg. [stackexchange](https://stackexchange.com/opensearch.xml). I know how to do it manually but I did not find a solution on how to pre-configure it for all users at once. Already [asked this...
On multi-user Debian systems with
firefox-esr
128 I'd like to add search engines to the firefox search bar eg. [stackexchange](https://stackexchange.com/opensearch.xml) .
I know how to do it manually but I did not find a solution on how to pre-configure it for all users at once.
Already asked this on serverfault without success :(
Christo
(129 rep)
Jan 9, 2025, 01:48 PM
• Last activity: Jan 9, 2025, 02:00 PM
1
votes
0
answers
41
views
Interruptible disk usage tallies for users?
I want to obtain, for every one of my system's users (or at least, every one with a home directory under `/home`), the amount of disk space their files use. I have root access, but - there are many users with lots and lots of files, and the directory is an nfs-mount. So, counting is kind of slow; an...
I want to obtain, for every one of my system's users (or at least, every one with a home directory under
/home
), the amount of disk space their files use. I have root access, but - there are many users with lots and lots of files, and the directory is an nfs-mount. So, counting is kind of slow; and my machine may be rebooted in the process, so I need to be able to resume counting after the machine is up again.
What would be a decent way of achieving this?
I don't very much mind the output format.
Notes:
* I can't set quotas. I mean, I have root access, but I don't get to do what I want.
einpoklum
(10753 rep)
Dec 15, 2024, 04:27 PM
• Last activity: Dec 15, 2024, 05:35 PM
0
votes
2
answers
85
views
Upgrade to custom kernel with no multiuser support
I am playing around with kernel customization on my headless Ubuntu Server system. Currently I have 6.8.0-48-generic kernel. My intention is to remove kernel features that I don't need. I decided to start with removing multiuser support so that there would only be root user (mainly to not type sudo...
I am playing around with kernel customization on my headless Ubuntu Server system. Currently I have 6.8.0-48-generic kernel. My intention is to remove kernel features that I don't need. I decided to start with removing multiuser support so that there would only be root user (mainly to not type sudo for everything). I have built the kernel using my /boot/config-6.8.0-48-generic as a base with disabled CONFIG_MULTIUSER.Disabling this option also removes setuid syscall and turnes out a lot of my existing applications rely on it. During boot process I see a lot of "setuid: Function not implemented"-like messages. The problem is that I don't even get a shell after boot (neither on serial or on an monitor, ssh is also not running). What would be thet steps to proceed further? How can I "tell" the applications that the system is single-user now. Or at least, how can I get a shell?
If you intend to reply with something like "this is a security risk" please ignore this post.
Oleksandr Tashno
(21 rep)
Nov 18, 2024, 07:56 PM
• Last activity: Nov 18, 2024, 10:12 PM
13
votes
9
answers
16082
views
Is there a multi-user webdav server available for linux?
I'm looking to completely decommission my SMBA service and replace it with a WebDav service. All the google searches so far have pointed me to using Apache / Webdav. This is close to what I need but as far as I read it requires Apache to have access to my user's files and worse; if it creates a file...
I'm looking to completely decommission my SMBA service and replace it with a WebDav service.
All the google searches so far have pointed me to using Apache / Webdav. This is close to what I need but as far as I read it requires Apache to have access to my user's files and worse; if it creates a file the new file will be owned by Apache (not the user). ***Note that having files with the correct Unix ownership and permissions is a requirement as some users have direct SSH access.***
So I'm quite simply looking for a way to either make Apache / Webdav work "correctly" with multi-users (that is ***change unix user to the logged in user before attempting to serve the file***) or find a complete alternative to Apache / Webdav.
So far searches haven't turned anything up.
Philip Couling
(20391 rep)
Apr 3, 2014, 06:05 PM
• Last activity: Nov 3, 2023, 09:03 PM
0
votes
1
answers
148
views
Starting user units from custom path
I have successfully enabled user units in RHEL 8 under ~/.config/systemd/user directory. Enabling linger also gives me the option to start the service without having to login. My question, is it possible to have user units, namely .service files, located at a different path other than ~/.config/syst...
I have successfully enabled user units in RHEL 8 under ~/.config/systemd/user directory. Enabling linger also gives me the option to start the service without having to login. My question, is it possible to have user units, namely .service files, located at a different path other than ~/.config/systemd/user and still be able to start these user units just like I am able to do now?
Casper Netherlands
(1 rep)
Nov 3, 2023, 04:09 AM
• Last activity: Nov 3, 2023, 09:12 AM
2
votes
1
answers
458
views
Configure screen to have multiuser support
Following up on https://unix.stackexchange.com/questions/163872/sharing-a-terminal-with-multiple-users-with-screen-or-otherwise Same as the first comment, my screen complains about needing suid root, and `sudo chmod u+s /usr/bin/screen` fixes that for me. However, when the guest tries to connect to...
Following up on https://unix.stackexchange.com/questions/163872/sharing-a-terminal-with-multiple-users-with-screen-or-otherwise
Same as the first comment, my screen complains about needing suid root, and
sudo chmod u+s /usr/bin/screen
fixes that for me.
However, when the guest tries to connect to the screen session with
screen -x youruser/multisession
He's getting:
chmod /dev/pts/13: Operation not permitted
How to fix for that?
The bugs at https://bugs.launchpad.net/ubuntu/+source/screen/+bug/1173312 reported the same issue, yet the conclusion was that it was _"fixed in trusty"_ in 2014.
Mine is Ubuntu 22.04.2 LTS
, and I'm still having such Operation not permitted
issue.
xpt
(1858 rep)
Oct 24, 2023, 01:29 AM
• Last activity: Oct 24, 2023, 02:25 AM
2
votes
2
answers
139
views
Turn on keyboard backlight from multi-user.target
Is there a way to turn on the keyboard backlight from the multi-user.target environment? As X11 is not loaded, the command `xset led on` does not work and gives `xset: unable to open display ""`. Currently, I am wanting the keyboard backlight to turn on each time the system starts (only if the keybo...
Is there a way to turn on the keyboard backlight from the multi-user.target environment? As X11 is not loaded, the command
xset led on
does not work and gives xset: unable to open display ""
.
Currently, I am wanting the keyboard backlight to turn on each time the system starts (only if the keyboard is present). I would also like the keyboard backlight to turn on regardless the system loading in a graphical or non-graphical environment. Preferably, I would like this done through Cron.
Bill Joe
(49 rep)
Jul 16, 2023, 09:50 AM
• Last activity: Jul 16, 2023, 05:45 PM
1
votes
1
answers
2178
views
How to run a graphical application as another user?
Let's an user A (`userA`) wants to run in his graphical session a graphical application as user B (`userB`). How is it done it on a modern GNU/Linux system?
Let's an user A (
userA
) wants to run in his graphical session a graphical application as user B (userB
). How is it done it on a modern GNU/Linux system?
Scrooge McDuck
(1102 rep)
Jul 16, 2022, 12:51 AM
• Last activity: Apr 9, 2023, 04:11 AM
0
votes
0
answers
19
views
Categorizing Debian Linux VPS
I like to Categorize or Divide one Debian VPS for different Tasks and Testing. For Example two Apache Web Servers with no any connection between both. Something like installing apache2 web server only to user A and the user B can't even watch or check the user A apache webserver without access while...
I like to Categorize or Divide one Debian VPS for different Tasks and Testing.
For Example two Apache Web Servers with no any connection between both. Something like installing apache2 web server only to user A and the user B can't even watch or check the user A apache webserver without access while user B can run a seperate apache server.
The purpose for this is in case I want to migrate user A Web Server and Configurations to new seperate vps without any hindrance to user B data, databases and configuration, securely.
I think my requirements are clear.
Eventhough, I just said I want divide maintain migrate user seperately, I don't how to do any of them. I am just new to linux and I think I can get a detailed answer on my question.
Thanks in Advance
zakadmin
(63 rep)
Jun 22, 2022, 08:13 PM
2
votes
0
answers
2313
views
systemd resource control -- all users/root
I'm using Debian Bullseye with `systemd` 247. I have more than a hundred of users and I would like to enforce some limits using `cgroups`. I use `set-property`, which works as expected, for example for the memory and `AllowedCPUs` properties: ``` systemctl set-property user.slice MemoryHigh=300G sys...
I'm using Debian Bullseye with
systemd
247. I have more than a hundred of users and I would like to enforce some limits using cgroups
. I use set-property
, which works as expected, for example for the memory and AllowedCPUs
properties:
systemctl set-property user.slice MemoryHigh=300G
systemctl set-property user.slice MemoryMax=305G
systemctl set-property user.slice AllowedCPUs=9-64
The idea is to allow ordinary users to use 80-90% of the memory and most of the CPUs. The other 10-20% of the resources should always be available for other slices *and* for the root
user (we were very liberal with setting the limits and recently we accidentally were fork-bombed by a student).
But the limits seems to also affect the root
user and I cannot find a user@0.slice
or anything like that. The idea is to allow the root
to use the spare resources if thigs go wrong and always have some spare I/O, memory and CPU aside. cgroups
seems like a good idea, because all switches are there. Could someone help and tell how to achieve this goal or give some general best practices with systemd
/cgroups
in multiuser environment? Or am I doing this completely wrong and this should be done differently?
### Proposed answer (June 19th, 2022):
I think I managed to do it as described below, but I do not know if this is a "right" way to do it.
* systemd
has a hierarchy within drop-in
directories. In general, the more specific drop-in
directories definitions override the less specific ones. (https://www.freedesktop.org/software/systemd/man/systemd.unit.html#)
* /etc/systemd/system/user-.slice.d/somethin.conf
will be overriden by /etc/systemd/system/user-0.slice.d/something.conf
. Limits set in the former directory will apply to all users including root
, but the definitions in the latter directory will override them and apply *only* to root
. (https://www.freedesktop.org/software/systemd/man/user@.service.html)
* Using spare resources reserved for the root
user requires a proper root
login, for example on a TTY or through a console in case of a virtual machine. sudo
or su
are methods of elevating privileges, but do not hook into cgroup
system (or at least I do not know how to do this). Using sudo
or su
the user is still bound by the user-UID@
slice limits.
Kind Regards
~~
K.
Kamil
(1501 rep)
Jun 18, 2022, 11:56 AM
• Last activity: Jun 19, 2022, 05:27 PM
2
votes
1
answers
1418
views
Multiuser Homebrew privileges
I have two users on my Mac. Both are me, but one is work mode, the other is non-work mode. I have an ongoing issue with installing via homebrew. $ brew install x Error: Can't create update lock in /usr/local/var/homebrew/locks! Fix permissions by running: sudo chown -R $(whoami) /usr/local/var/homeb...
I have two users on my Mac. Both are me, but one is work mode, the other is non-work mode. I have an ongoing issue with installing via homebrew.
$ brew install x
Error: Can't create update lock in /usr/local/var/homebrew/locks!
Fix permissions by running:
sudo chown -R $(whoami) /usr/local/var/homebrew
Of course, executing this suggested code solves the problem -- until I need to brew install using my other user, then I need to change ownership again. How can I set the permissions so that both users can install with homebrew?
steel
(375 rep)
Mar 15, 2017, 01:22 AM
• Last activity: Jun 1, 2022, 12:44 PM
39
votes
3
answers
65791
views
Sharing a terminal with multiple users (with screen or otherwise)
I am setting up a server where there are multiple developers working on multiple applications. I have figured out how to give certain developers shared access to the necessary application directories using the `setgid bit` and `default ACLs` to give anyone in a group access. Many of these applicatio...
I am setting up a server where there are multiple developers working on multiple applications.
I have figured out how to give certain developers shared access to the necessary application directories using the
setgid bit
and default ACLs
to give anyone in a group access.
Many of these applications run under a terminal while in development for easy access. When I work alone, I set up a user for an application and run screen as that user. This has the downside that every developer to use the screen session
needs to know the password and it is harder to keep user and application accounts separate.
One way that could work is using screen multiuser features. They do not work out-of-the-box however, screen complains about needing suid root
. Does giving that have any downsides? I am pretty careful about using suid root
anything. Maybe there is a reason why it isn't the default?
Should I do it with screen
or is there some other intelligent way of doing what I want?
varesa
(2446 rep)
Oct 23, 2014, 08:43 PM
• Last activity: May 6, 2022, 03:05 PM
3
votes
3
answers
25273
views
Is there a GUI to edit/add users and groups
Is there a graphical tool that shows (edits) *all* users and groups on the system, so that one can avoid editing `/etc/passwd` and `/etc/group` directly? [GNOME Settings](https://gitlab.gnome.org/GNOME/gnome-control-center) (`gnome-control-center`) *Users* view lets only see desktop users and no gro...
Is there a graphical tool that shows (edits) *all* users and groups on the system, so that one can avoid editing
/etc/passwd
and /etc/group
directly?
[GNOME Settings](https://gitlab.gnome.org/GNOME/gnome-control-center) (gnome-control-center
) *Users* view lets only see desktop users and no groups at [all](https://help.gnome.org/users/gnome-help/stable/user-accounts.html.en) .
Scrooge McDuck
(1102 rep)
Feb 11, 2020, 03:01 PM
• Last activity: Oct 24, 2021, 09:59 AM
-8
votes
2
answers
69
views
How Does Unix Interpret $?
[orca@orcacomputers public_html]$ adduser Jé$$è+rèè adduser: invalid user name 'Jé28956è+rèè' I am unable to use $ when adding users in CentOS7. Karen goes "WHY THE HELL WOULD YOU DO THAT!?" as she socially crucifies me as I am being my authentic self with is...
[orca@orcacomputers public_html]$ adduser Jé$$è+rèè
adduser: invalid user name 'Jé28956è+rèè'
I am unable to use $ when adding users in CentOS7. Karen goes "WHY THE HELL WOULD YOU DO THAT!?" as she socially crucifies me as I am being my authentic self with is a Left Handed Neanderthal. Curiosity.
I am an auditor by trade so I increase my levels of happiness when I curate data. So what is $ telling unix here? What I can is so far is
$$=28956
in unix. Is this a random string?
Are there any ways to use the $
character to sort data? or any other usecase that would be deemed productive for Computer Science purposes?
[orca@orcacomputers public_html]$ adduser Jéssè+rèè
adduser: invalid user name 'Jéssè+rèè'
What really!? Is this where I have to make my own distribution?
mister mcdoogle
(505 rep)
Feb 19, 2021, 08:25 PM
• Last activity: Feb 19, 2021, 09:39 PM
2
votes
0
answers
158
views
PulseAudio ignoring seat assignment when plugging in USB audio device
I'm trying to create a multiseat setup for two seats, with a monitor, keyboard, mouse, and USB soundcard for each seat. With my primary user logged in, I created a second seat with its own monitor, keyboard, and mouse using loginctl attach as described in https://wiki.archlinux.org/index.php/Xorg_mu...
I'm trying to create a multiseat setup for two seats, with a monitor, keyboard, mouse, and USB soundcard for each seat. With my primary user logged in, I created a second seat with its own monitor, keyboard, and mouse using loginctl attach as described in https://wiki.archlinux.org/index.php/Xorg_multiseat . GDM started on that seat automatically. I have everything for the second seat plugged into a powered USB hub, and I assigned that hub to the second seat, as recommended in the above link:
>It would be more flexible to add a specific USB port to the seat instead, allowing any device plugged into that USB port to be assigned to the seat (keyboard, mouse, USB sound card, etc.) Here, two USB ports are assigned to the seat, which you can see has just come from the same list above with the end part removed:
I logged in as a separate user on on that seat. I can see two pulseaudio processes running, one for each seat, and I'm using the system default pulseaudio configuration for both users. If I do "loginctl seat-status seatnew", I see all devices plugged into that second hub listed as expected, including the audio device. When I unplug my USB audio device, and then plug it back in, it seems that both of the pulseaudio processes try to grab the device with their udev module, instead of just the one whose user is logged in at that seat.
I would expect Pulseaudio's udev module should be paying attention to the ID_SEAT, which I verified was assigned properly to the second seat using udevadm info. Why is the wrong pulseaudio process sometimes picking up the audio device plugged into the second seat USB hub?
davex_
(51 rep)
Dec 9, 2020, 12:07 AM
2
votes
2
answers
1437
views
How do I keep track of when each user is actively using the GUI on Ubuntu?
I have a different user for each of my own work areas on my system. This is to keep bookmarks, files and other defaults separate. Several "users" are generally logged in at once and I just switch between them when I change which project I'm working on in that moment. I am using Ubuntu 18.04 with Gno...
I have a different user for each of my own work areas on my system. This is to keep bookmarks, files and other defaults separate.
Several "users" are generally logged in at once and I just switch between them when I change which project I'm working on in that moment.
I am using Ubuntu 18.04 with Gnome Desktop Environment
I'd like to keep track of when I've been working on different projects and I figured tracking these sessions would be an easy way to do this, however I don't know if there is a log available that knows which user is using the GUI at any one time, or how to create such a tracker.
The two details I think are needed for the tracker are:
1.) Events where a user logs in, including the times when the user is unlocking a session that is already open
2.) When screen locks due to inactivity
Does anyone know if these are already/can be logged?
Thanks!
Woody
Solution: ( With help from meuh below and this question: https://unix.stackexchange.com/questions/28181/how-to-run-a-script-on-screen-lock-unlock )
This following script needs to be run from ~/.profile for each user that I wish to keep track of, their login/logout times all get logged in the OUTPUTFILE
The initial echo is because the script only gets run after the user has logged in and would otherwise be missed. All subsequent logins are caught from dbus-monitor
#!/bin/bash
echo $(date), $USER, SCREEN_UNLOCKED >> OUTPUTFILENAME
dbus-monitor --session "type='signal',interface='org.gnome.ScreenSaver'" |
while read x; do
case "$x" in
*"boolean true"*) echo $(date), $USER, SCREEN_LOCKED >> OUTPUTFILENAME;;
*"boolean false"*) echo $(date), $USER, SCREEN_UNLOCKED >> OUTPUTFILENAME;;
esac
done
Woody
(23 rep)
Nov 21, 2020, 04:47 PM
• Last activity: Dec 5, 2020, 10:11 PM
3
votes
1
answers
742
views
mount.cifs not supporting 'multiuser'?
I was going to use the "multiuser" option for mount.cifs, but /var/log/messages reports: ``` kernel:CIFS: unknown mount option multiuser ``` * Kernel is 2.6.18-433 * mount.cifs is 1.12RH I can't find information which version of mount.cifs is supporting multiuser. I guess RHEL 5.11 and its kernel ar...
I was going to use the "multiuser" option for mount.cifs, but /var/log/messages reports:
kernel:CIFS: unknown mount option multiuser
* Kernel is 2.6.18-433
* mount.cifs is 1.12RH
I can't find information which version of mount.cifs is supporting multiuser. I guess RHEL 5.11 and its kernel are too old for it? Can anyone confirm?
Ti NX
(43 rep)
Sep 22, 2020, 01:06 PM
• Last activity: Sep 24, 2020, 01:36 PM
4
votes
0
answers
231
views
How to run script when switching to specific (already logged in) user
There's plenty of info out there on how to run a script at login (add it to .xprofile etc.), but I'm looking for a solution that will run a script/command not just at login but *also* every time a particular user's session is activated/brought to the foreground. ### Concrete Example ### I have two u...
There's plenty of info out there on how to run a script at login (add it to .xprofile etc.), but I'm looking for a solution that will run a script/command not just at login but *also* every time a particular user's session is activated/brought to the foreground.
### Concrete Example ###
I have two users on my system, John and Jane. On a typical day, John logs on to a graphical session in the morning, adjusts his settings the way he likes (for argument's sake, he works with the display backlight at 100%), does an hour of work, and then locks his session (but *does not* log out). A while later, Jane logs in, sets the backlight to 0%, does some work, locks her session, and leaves.
My issue is now, when John comes back, he unlocks and reactivates his earlier session. He curses Jane for setting the backlight to 0% again, and because he's not logging in to a new session, there's no option to automate backlight adjustment by adding commands to .xprofile or .xsessionrc
### My Setup ###
I'm on debian buster with lightdm and xfce
### Things I've Tried ###
The closest I've come to a solution is listening to dbus-monitor --system for lightdm or systemd-logind messages to hook into, but I just don't know how to identify a specific enough message trigger (specific to user and to session activation)
### Question ###
How can one ensure a script gets run every time a particular user unlocks/reactivates his/her graphical session?
user629422
(41 rep)
Aug 2, 2020, 09:05 AM
• Last activity: Aug 16, 2020, 12:42 PM
Showing page 1 of 20 total questions