75 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 ...
BoomShadow's user avatar
51 votes

Where should a local user executable be placed (under $HOME)?

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 ...
MattSturgeon's user avatar
38 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 ...
MADforFUNandHappy's user avatar
38 votes

What is the bin user for?

bin has not properly been for anything for the entire lifetime of Linux. Like run-levels and init spawning getty because of records in /etc/inittab, the bin account was obsolete in the Unix world ...
JdeBP's user avatar
  • 68.8k
32 votes
Accepted

How is allowing login for a sudo group member safer than allowing root login?

sudo improves safety/security by providing accountability, and privilege separation. Imagine a system that has more than one person performing administrative tasks. If a root login account is enabled, ...
Seamus's user avatar
  • 2,949
30 votes

How to install libtoolize as non-root user

The software package is libtool : https://www.gnu.org/software/libtool/
schaiba's user avatar
  • 7,631
27 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 ...
bufh's user avatar
  • 379
26 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 ...
Benoit Blanchon's 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. ...
Kusalananda's user avatar
  • 334k
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....
imz -- Ivan Zakharyaschev's user avatar
18 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 ...
JdeBP's user avatar
  • 68.8k
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 ...
heemayl's user avatar
  • 56.3k
17 votes

How to install libtoolize as non-root user

This solves the problem: sudo apt-get install libtool
CommonSenseCode's user avatar
16 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 ...
Rich's user avatar
  • 161
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 ...
Zachary Brady's user avatar
15 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/...
Reda Salih's user avatar
  • 1,754
13 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 -...
Carlo Wood's user avatar
13 votes

How is allowing login for a sudo group member safer than allowing root login?

If you use ssh with a key to login, then the password is a 2nd factor. There is also a small amount of protection in not using a default user name. (As noted by others, this protection is that it ...
ctrl-alt-delor's user avatar
12 votes
Accepted

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

In my case, I was placing my systemd unit files directly under /etc/systemd/system/... folders. Moved them to /lib/systemd/system instead and that resolved the issue with systemctl enable/disable ...
Alex's user avatar
  • 235
12 votes
Accepted

How to install dos2unix on Linux without root access?

Other answers show how to download and compile dos2unix, but if you're simply looking to convert files from DOS-style line endings (CR-LF) to Unix-style line endings, there are several other ...
Stephen Kitt's user avatar
12 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 ...
Ciro Santilli OurBigBook.com's user avatar
11 votes

How to mount a local directory without root

Various FUSE utilities can do that. For instance, bindfs can mount a directory to a different location, similarly to what mount --bind would do. bindfs --no-allow-other /source/directory /mount/point ...
fra-san's user avatar
  • 10.2k
11 votes

How is allowing login for a sudo group member safer than allowing root login?

sudo helps improve security in a couple of ways: It allows for fine-grained permissions. Among other things, with sudo you can: Prevent a user from trivially accessing an administrative shell (which ...
Austin Hemmelgarn's user avatar
10 votes

Creating a user without a password

I think this is what you want: adduser --disabled-password --shell /bin/bash --gecos "User" $username You'll be able to su $username to run commands as that user, in /bin/bash or whatever shell ...
Douglas Krugman's user avatar
10 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 ...
Ciro Santilli OurBigBook.com's 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: ...
Henrik supports the community's user avatar
10 votes

Install curl without being root

You can install curl as non-root using a prefix where you have write permissions. Download curl sources, untar and cd into the extracted directory. Then ./configure --prefix=$HOME/usr make make ...
rudimeier's user avatar
  • 10.3k
10 votes

Installing software without root user access

Virtually all user-space programs may be installed by an unprivileged user in Unix, if the installation is done to a directory that the user has write permissions to. For software packages that comes ...
Kusalananda's user avatar
  • 334k

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