Questions tagged [sudo]

sudo is a tool which allows users to run commands as another user (usually the root user)

sudo allows users to run commands as another user. It is typically used to allow trusted users to run commands as root, without giving them root access, or to allow a user to run commands as another user. Both of these uses must be allowed by the root user.

886 questions
0
votes
1 answer

Control a systemd service through a web application built in python3

I have created a web app in python3 which is hosted on an apache2 web server using the WSGI module. Now one of the requirements of the web application is that it needs to restart a systemd service based on some user inputs. Now I know there is os…
DG12
  • 1
  • 1
0
votes
2 answers

Is using sudo a bad practice?

I heard that using sudo for creating files is a bad practice(for security reasons) and should instead "confine them" to user or a group, can someone make me and example of what could go wrong if I go under /user and install there for example java?…
0
votes
0 answers

Locked of Server, how to run sudo passwordless

Here is the issue Created a new server with Amazon Linux 2 Removed ssh-key from default root user (ec2-user) Created two new accounts with sudo access without a password Now I got locked out of the root access in this server, anytime I run a…
asosnovsky
  • 101
  • 1
0
votes
0 answers

Any downside to using `sudo git` to upload `/etc/nginx/sites-available/` and `/etc/nginx/ssl/` config files on github?

I'm contemplating uploading config files from /etc/nginx/sites-available/ and /etc/nginx/ssl to a private Github repository. Doing so would require me to use git with sudo (or from root user) for the ssl folder at least (which can only be read by…
Jean Monet
  • 121
  • 6
0
votes
1 answer

On RedHat 8, is using SUDO to perform tasks as privileged (like starting a systemd service) user deprecated in favor of using PolicyKit?

Just a bit of context... I got some legacy System V Init script that were converted to Systemd unit configuration files for RedHat 7. Problems with abrupt termination of user processes running in the user.slice led me to the discovery that…
Francozen
  • 163
  • 5
0
votes
1 answer

How can I mount a hard drive with read/write permissions for all the users listed on the Linux server?

Two users user1 and user2 are registered on the server, both with sudo access. user1 mounted a hard drive with: $ sudo mount /dev/sda /media/user1/DATA $ ll /media/user1 total 12K drwx------ 19 user1 user1 4.0K 2020-01-25 23:44:42 DATA How can we…
0
votes
0 answers

I am using 'sudo apt-get clean' too often nowadays, how can I avoid using it again?

I have a LAMP server hosted by Digital Ocean that has been running for more than 3 years. I use the server to run an ERP page where users have to log in to do what they need to do. Up until recently people could enter the ERP without a problem and…
Julio Garcia
  • 103
  • 5
0
votes
1 answer

Allow apache service to execute command on another user with sudo. Set correctly SELinux

I want allow PHP script to execute external command with another user with exec. For this, I call my command like : exec('sudo -u username /usr/bin/command -a arg1 --arg2 arg2'); In sudoers rules, I have added : apache …
user5525652
  • 157
  • 1
  • 4
  • 14
0
votes
1 answer

Do I need to specify the user:group in sudoers to impersonate other users

I was trying to limit the command a specific user can execute in the sudoers file, say I have something like this: dummy myserver=(ALL:ALL) /usr/sbin/reboot,/usr/sbin/shutdown My dummy user is only allowed to reboot or shut down the system. I…
-1
votes
2 answers

sudo user is not allowed to execute systemctl

I'm trying to allow a user to use sudo to manage a custom systemctl service, this however seems to fail and I can't figure out why. [root@testvm sudoers.d]# ll total 16 -r--r-----. 1 root root 334 Oct 9 15:42 20_appgroup -r--r-----. 1 root root 104…
Mark Visser
  • 3
  • 1
  • 1
  • 3
-1
votes
1 answer

`sudo apt-get -f install` fails everytime

This command sudo apt-get -f install fails every time I try to run it.
rockower
  • 99
  • 4
-1
votes
1 answer

visudo + read access to file from non root user

how to access file by visudo from non root user , or other option for example when we change user to hdfs and from user hdfs we want to print the file - file.cfg we get Permission denied how to configure the visudo in order to get read access from…
jango
  • 59
  • 2
  • 3
  • 12
-1
votes
1 answer

Sudo on UNIX. does not prompt for password for switching to other user

I configured sudo. But when i login to a user with sudo, it will prompt me for my password. However if I su to other user it will not ask me for a password. How do i tackle this? Please see the below log $ id uid=228(sudotst) gid=204(L1Group)…
-1
votes
1 answer

What is the purpose of the -Hu argument for sudo?

I've seen several sudo commands that begin as so: sudo -Hu apache What is the purpose of the -Hu argument, and how does it pertain to the apache command that follows?
Gokhan
  • 111
-1
votes
1 answer

Sudo not asking for password

I have a problem with my Antergos installation, when I try to sudo a command it won't ask root password: Also Ctrl + C won't stop the command. Can't connect to WiFi (Network manager is not running and unpossible to start it). I don't know what to…
Adraqi
  • 1