I want to allow a particular user to execute a compiled program in my directory. I got his username from cat /etc/passwd. The executable does not write any file but reads a few and gives output on the command line.
How can I achieve this?
Linux Bash – Allow Another User to Execute Program
bashcentoslinux
Best Answer
If your files are not a secret, you may simply make that folder readable to everyone, or to some group where you will put yourself and the other user.
If you have a scenario with users that should not be allowed access to reading those data, you will have to use a
sudo
-based strategy, so that the privileged user can run your program by means of for example:First you have to configure your sudo (by means of
visudo
) with something like:NOPASSWD avoids you the need to enter your own password, which you probably want.