104 votes
Accepted

Why doesn't my systemd user unit start at boot?

Figures that I'd figure this out on my own. The clue was here, in the user service output: Dec 23 19:43:27 redmine systemd[613]: Reached target Default. My unit was asking to be loaded with multi-...
user avatar
74 votes

Creating a user without a password

The --disabled-password option will not set a password, meaning no password is legal, but login is still possible (for example with SSH RSA keys). To create an user without a password, use passwd -...
user avatar
  • 1,017
67 votes
Accepted

How could we allow non-root users to control a systemd service?

Just add all needed commands to sudoers separately: %webteam cms051=/usr/bin/systemctl restart httpd.service %webteam cms051=/usr/bin/systemctl stop httpd.service %webteam cms051=/usr/bin/systemctl ...
user avatar
  • 25.5k
62 votes

How could we allow non-root users to control a systemd service?

@jofel's answer was exactly what I needed to get a working setup. POsting this for anyone else stumbling on this question. I needed a way to have capistrano restart my Ruby application after deploying ...
user avatar
56 votes

Install R in my own directory

The easiest way to do this is to install R from source: $ wget http://cran.rstudio.com/src/base/R-3/R-3.4.1.tar.gz $ tar xvf R-3.4.1.tar.gz $ cd R-3.4.1 $ ./configure --prefix=$HOME/R $ make &&...
user avatar
  • 68.9k
45 votes

Where should a local executable be placed?

As uther mentioned, /usr/local is intended as a prefix for, essentially, software installed by the system administrator, while /usr should be used for software installed from the distribution's ...
user avatar
32 votes

Can I create a user-specific hosts file to complement /etc/hosts?

Private mountspaces created with the unshare command can be used to provide a private /etc/hosts file to a shell process and any subsequent child processes started from that shell. # Start by ...
user avatar
  • 380
28 votes
Accepted

Bluetooth LE scan as non root?

The Bluetooth protocol stack for Linux checks two capabilities. Capabilities are a not yet common system to manage some privileges. They could be handled by a PAM module or via extended file ...
user avatar
  • 396
28 votes
Accepted

How to resolve 'No protocol specified' for su user

The problem is not occurring because of the UID of the user. 500 is just fine as a UID, and that UID doesn't make it a 'non-login' user except in the eyes of the default settings of some few display ...
user avatar
  • 41.4k
25 votes

I can't enable or disable a user service: Failed to execute operation: No such file or directory

Symlink issue? I had a similar error message when using symbolic links. Apparently systemd doesn't follow symbolic links, the solution is simply to copy or move the file. User service? I believe ...
user avatar
24 votes

How to resolve 'No protocol specified' for su user

In my case the new display server protocol wayland was the problem, just do xhost + local: then other users (e.g. root) are allowed to run programs in your session, network connections however will ...
user avatar
24 votes
Accepted

make all the processes of a given user killable by anyone

Give the other users permission to kill the processes as the low priority user through sudo -u lowpriouser /bin/kill PID A user can only signal their own processes, unless they have root privileges. ...
user avatar
  • 276k
22 votes

Alternative to iotop for non-root user without sudo privileges

To reference a few more tools. htop http://hisham.hm/htop/ https://github.com/hishamhm/htop Command line tool, packaged in most distributions, is able to show the I/O without root privileges but ...
user avatar
  • 329
19 votes
Accepted

How to enable user_namespaces in the kernel? (For unprivileged `unshare`.)

Debian-based Linux Debian (and hence probably Ubuntu, too) has been known to ship a kernel with such a restriction of user_namespaces, and there the way to enable it was/is: sysctl -w kernel....
user avatar
17 votes
Accepted

Using "su - " to change user gives "No passwd entry for user"

The error message is pretty much self-explanatory. It says that the user jenkins has no entry in the /etc/passwd file i.e. the user does not exist in the system. When you do any user related ...
user avatar
  • 51.3k
15 votes

Why does 'cat useradd' succeed in this case?

In the image you show that the "other" group has read permissions; if you tried to append echo testline >> useradd or execute ./useradd it would give you a permission denied. If you're looking ...
user avatar
14 votes
Accepted

What are benefits and downsides of unprivileged containers?

Running unprivileged containers is the safest way to run containers in a production environment. Containers get bad publicity when it comes to security and one of the reasons is because some users ...
user avatar
  • 324
13 votes

systemctl --user not available for www-data user

The per-user instance of systemd is started by a hook into the login process, a pam_systemd PAM, for both ordinary virtual/real terminal login and remote login via SSH and otherwise. You are not ...
user avatar
  • 62.9k
10 votes

Non-Root Package Managers

I use JuNest which basically allows to have a really tiny linux distribution (containing just the package manager) inside your $HOME/.junest directory. It allows to have your custom system inside the ...
user avatar
10 votes
Accepted

How to use libraries installed by nix at run-time?

TL;DR The working solution is using patchelf (if you have to deal with non-matching glibc versions: in the host system and the one nix libs have been linked with), see the second half of my story. ...
user avatar
10 votes

How could we allow non-root users to control a systemd service?

Create a command alias with the commands you want them to have access to. Then assign the group to that command alias: Cmnd_Alias APACHE-SVC = /usr/bin/systemctl stop httpd, /usr/bin/systemctl start ...
user avatar
  • 101
10 votes

How to resolve 'No protocol specified' for su user

Suppose you want to brute force get yourself a connection with X... Lets assume you are already running your commands on the server (where X runs), otherwise get that to work first and then use 'ssh -...
user avatar
10 votes
Accepted

How come root can do this, but sudo can't?

Because sudo cmd > file is interpreted as (sudo cmd) > file by your shell. I.e. the redirect is done as your own user. The way I get around that is using cmd | sudo tee file Addition: ...
user avatar
10 votes
Accepted

How can I find active network interface from userland?

Something like this? ip addr | awk '/state UP/ {print $2}' enp0s3: This command was issued as a "regular" (non-root) user on: uname -a Linux centos 3.10.0-514.el7.x86_64 #1 SMP Tue Nov 22 16:42:41 ...
user avatar
  • 8,098
10 votes

create a filesystem as a non root user

mke2fs -d minimal runnable example without sudo mke2fs is part of the e2fsprogs package. It is written by the famous Linux kernel filesystem developer Theodore Ts'o who is at Google as of 2018, and ...
user avatar
10 votes
Accepted

What does the `--system` flag for **adduser** do?

System users are a like normal users but for are set an organizational purpose. The only difference is : They don't have an expiry date ( no aging set ) Their uids are below 999 like set on /etc/...
user avatar
  • 1,614
9 votes

How to install program locally without sudo privileges?

You can use JuNest, which creates a small Linux container in user's directory, where you can install any packages.
user avatar
  • 388
9 votes

Creating a user without a password

Create an user with empty password sudo useradd test-user-0 echo test-user-0:U6aMy0wojraho | sudo chpasswd -e su test-user-0 The password prompt still shows unfortunately. But if you just hit enter ...
user avatar
9 votes

How to get dmidecode information without root privileges?

Some of the information presented by dmidecode is available at /sys/devices/virtual/dmi/id. Other information can be obtained by analysing /proc/cpuinfo, /proc/meminfo or /sys/system/node/node0/...
user avatar
  • 144
9 votes

How to allow non-superusers to mount any filesystem?

Here is the wiki for configuring polkit rules for udisks/udisks2 in order to mount partitions by non-root (e.g. users) group. Save the code below to /etc/polkit-1/rules.d/50-udisks.rules polkit....
user avatar
  • 267

Only top scored, non community-wiki answers of a minimum length are eligible