sudo - Execute a command with superuser privileges.

learn more… | top users | synonyms

7
votes
3answers
507 views

Can vim edit a remote file as root?

I've found this question that explains how to edit a remote file with vim using: vim scp://user@myserver[:port]//path/to/file.txt Is it possible to do this as root (via sudo) on the remote host? ...
0
votes
1answer
20 views

Echo while waiting for sudo prompt

I am using this way of elevating permissions in a script if not run as a root. My Bash script checks for the presence of a certain file it needs to use: if [ $EUID != 0 ]; then if [ -f "/foo/bar"...
0
votes
1answer
18 views

adding a sudoer in debian

After a long search on the web, trying everything I can find I came to ask you guys, how can I add an existing user to be a sudoer? I've tried usermod -a -G sudo user and also adduser user ...
1
vote
0answers
42 views

How to send sudo password over pipe? [duplicate]

I need to replace existing sshd config on the remote PC and restart sshd, so I try to use this: cat /sshd_cfg | ssh user@192.168.0.47 "cat > /etc/ssh/sshd_config && service sshd restart" ...
0
votes
1answer
72 views

Difference between sudo user and root user [closed]

The /etc/sudoers file lists which users can do what with the sudo command The root user creates and modifies the /etc/sudoers file. This concept is difficult for me to understand. If all users ...
0
votes
0answers
26 views

Linux Debian Jessie Sudo Command keeps asking for password

I have recent configured a Symfony 3 site which involved me to set up some permissions on the /var folder. I had to do the following: $ HTTPDUSER=`ps axo user,comm | grep -E '[a]pache|[h]ttpd|[_]www|[...
1
vote
2answers
51 views

`sudo: command not found' when following a tutorial for Let's Encrypt

I'm following a Godaddy help tutorial in order to install Let's Encrypt certificate for my website. So I connected to my server using ssh via Putty. Typing the command sudo git clone https://github....
6
votes
1answer
5k views

How do I allow non-root users to control a systemd service with instances?

I need to allow users in the dba group to control the database@ services. The answer to this related question is to just list all systemctl "verbs" that I want to allow in the sudoers file, however, ...
3
votes
3answers
3k views

I accidentally deleted the sudoers file on Mac OS X; is there any way to recover it?

I accidentalley deleted the sudoers file on Mac OS X; is there any way to recover it? And once you've recovered it, how do you set it to mode 0440? I presume not but I am desperate to get it back!
3
votes
1answer
39 views

Questions about sudo

I have a couple of questions on using sudo: Give Ben sudo access to the machine Give Tim sudo access to the following tool : iptables For (1) I just address Ben to the sudo group. So I did: ...
2
votes
1answer
39 views

using sudoers to allow non-privileged user to restart apache

We have production centos servers that run apache as root to allow low port numbers (80 and 443). We'd like a secure way for non-root users to restart apache. Are there any security implications ...
2
votes
0answers
17 views

How to allow traceroute to run as root on ubuntu

I'm trying to programatically call traceroute on Ubuntu but i'm getting blocked when trying to use the -I or -T flags for ICMP/TCP packets. Accroding to this question I can use the terminal command ...
0
votes
1answer
2k views

Allow www-data to perform specific commands

I need a PHP script to perform git pull however I am not naive enough to give it permissions on git. I've wrapped git pull in a script which www-data has permissions for, but I'm not sure how to give ...
0
votes
2answers
70 views

mussh no tty present and no askpass program specified

Using MUSSH on remote machine to execute a bash script $ mussh -a -i ~/.ssh/id_rsa -d -H mas-hostfile -c 'bash script.sh' -m2 sudo: unable to resolve host hostname aurelien@000.000.000: sudo: no tty ...
2
votes
1answer
52 views

Submit password with sudo and execute script with nohup

I would like to download and run a script in the background so the task is independent of the shell and its exit. Moreover this script should be run as sudo, using: echo MY_PWD | sudo -u MY_USER -S .....
3
votes
1answer
51 views

PAM failing to authenticate sudo, after successfully contacting ssh-agent

Setting up PAM sudo authentication, using ssh-agent, on 14.04.1-Ubuntu server LTS. I'm still unable to successfully authenticate sudo, via the ssh-agent, using PAM. Here are my relevant /var/log/...
2
votes
0answers
7 views

run gvfs-mount as user in a script owned by root for networkmanager dispatcher

I'm trying to create a script to auto mount using gvfs-mount for NetworkManager dispatcher. The dispatcher requires the script to be owned by root. Running gvfs-mount smb://path/ works in terminal as ...
13
votes
2answers
42k views

sudo as another user with their environment

$ whoami admin $ sudo -S -u otheruser whoami otheruser $ sudo -S -u otheruser /bin/bash -l -c 'echo $HOME' /home/admin Why isn't $HOME being set to /home/otheruser even though bash is invoked as a ...
7
votes
3answers
295 views

How to harden su with dpkg-statoverride?

I am reading an Ubuntu 14 hardening guide and this is one of the suggestions: It generally seems like a sensible idea to make sure that only users in the sudo group are able to run the su ...
2
votes
3answers
129 views

Why can I switch to a user but not run a script as it

If I try to switch to a user using command sudo su - kshitiz. It works fine and switches without asking for a password. But if I try to run a script as that user it asks me for a password. sudo -u ...
0
votes
0answers
22 views

Systemd, start user level unit with sudo access.

I have a debian package which installs my software and it needs to start two applications in post install script. First one is daemon and the second one is a background process both are managed with ...
1
vote
1answer
54 views

notify-send from root cron

On my system, notify-send requires 3 enviorment variables to run, which are kept in a file which is generated automatically on logon: /home/anmol/.env_vars: DBUS_SESSION_BUS_ADDRESS=unix:abstract=/...
1
vote
1answer
45 views

Why super user is disabled in iOS and Android

I know that both iOS and Android are based on UNIX. Then why is it that super user is disabled in both of them? In iOS we have to jail break and in Android we have to root. On the other hand in OS ...
12
votes
4answers
12k views

why does sudo work on Linux but not Android?

I have not had the chance to read enough about Android, Linux, or UNIX to answer this myself. sudo works on a Linux machine but doesn't work on Android unless you root the mobile device (e.g. Samsung ...
-1
votes
0answers
23 views

Unable to open software manager in linux mint with sudo/gksu

I'm unable to open software manager in linux mint. I open it and it asks for my password but after typing it, nothing pops up. When I try gksu mintinstall: I get on terminal Traceback (most recent ...
-1
votes
3answers
42 views

Run su -s with arguments

I run to run a command using the su -s command to start a process. Since I do not want the root user to own the process. I try to do this by issuing the command su -s "$CATALINA_HOME/bin/catalina.sh ...
10
votes
3answers
6k views

How could we allow non-root users to control a system.d service?

With sysvinit, a sudoers entry like this would suffice: %webteam cms051=/sbin/service httpd * This would allow for commands such as: sudo service httpd status sudo service httpd restart Now, ...
0
votes
1answer
57 views

Execute commands without sudo inside jenkins

I've imported a bunch of jenkins jobs and these jobs have a lot of shell script commands.There are no sudo before these commands.Jenkins has its own user.Is there a way so I can execute these commands ...
0
votes
1answer
60 views

How to Fix empty /etc/sudoers as root?

I did root@masi:~# visudo -x /etc/sudoers root@masi:~# exit logout masi@masi:~$ sudo apt-get install vim >>> /etc/sudoers: syntax error near line 1 <<< which I get because the ...
2
votes
3answers
63 views

Problem with sudoing ssh - `sudo ssh …` fails

I am trying to use git salt ssh access (which runs with root). The error is always: Permission denied (publickey). I managed to reproduce the problem, simulating what salt may be doing, by ...
128
votes
5answers
143k views

Why do I need a tty to run sudo if I can sudo without a password?

I have configured sudo to run without a password, but when I try to ssh 'sudo Foo", I still get sudo: sorry, you must have a tty to run sudo. Why does this happen and how can I work around it?
1
vote
1answer
45 views

sudo NOPASSWD is ignored [duplicate]

I want to be able to run the pm-suspend and pacman without sudo to ask me for a password for all users in the group sudo. I added the following line to my /etc/sudoers configuration following this QA:...
17
votes
2answers
2k views

Can I customize the sudo “this incident will be reported” message?

Is it possible, on Linux or on BSD systems, to customize the sudo "this incident will be reported" message? I've gone over man sudo and man sudoers on an Ubuntu 16.04 machine, a FreeBSD 10.2 machine, ...
4
votes
1answer
79 views

sudo takes too long to start

I'm using Fedora 23, the same problem was on Fedora 22. Sudo takes ~20 seconds to start, it doing something for ~20 seconds then asks password. Reboot solves this problem for a while. After a few ...
2
votes
1answer
57 views

How to restrict su from root to nis clients

We are using NIS services for users login for Unix accounts. We have test machines where users themselves install OS and they get root access. Users are using su from root account to NIS user accounts ...
1
vote
1answer
22 views

Alias that runs a command using sudo

Im always running a particular app as root because it requires more privileges. I usually just sudo it. I want to make an alias that is something similar to: alias myCmd='sudo nohup /path/to/binary &...
2
votes
1answer
922 views

sudo -u git clone

I'm on Ubuntu server 14.04. I am using apache web server which runs as the www-data. I need to do git clone from a script (a web hook). This script will run with www-data user privilages. Running ...
1
vote
2answers
40 views

Reason for requirement for root for package management

In package managers like pacman and apt, the root check is hard coded into source using guid checks. Why is this? A non privileged user can compile a program - let's say chromium browser - from ...
0
votes
1answer
34 views

To wget as New User without sudo in Raspbian

I have a new user masi in Raspbian Jessie. I want that it has access to /usr/bin/ etc wget. I did sudo adduser masi sudo visudo root ALL=(ALL:ALL) ALL masi ALL= NOPASSWD: ALL % ...
0
votes
1answer
43 views

Failed to syncronize cache for repo 'fedora' … (possible proxy issues)

I just started on a fedora build. Just managed to add myself to the sudoers file, so now I am attempting to grab vim. I do a sudo dnf install vim and get hit with the following error message. ...
0
votes
1answer
28 views

How do I edit sudoers file in fedora? [duplicate]

I have just started a new fedora build. I just got things going, and was about to install tmux, and was hit with the message... Error: This command has to be run under the root user Ok. I attempt ...
0
votes
1answer
44 views

Is it safe to uninstall `su` in favor of `sudo` to harden Arch Linux? [closed]

Is it safe to uninstall su in favor of sudo to harden Arch Linux? Have you got an opinion on whether this is a good or bad idea? I read the Arch Linux Wiki articles Security, Su and Sudo. I also ...
0
votes
0answers
20 views

alias pip to sudo pip

When using pip I almost always use sudo because otherwise it lacks permissions. I plan on adding an alias pip="sudo pip" in my .zshrc file. Is there a reason I shouldn't do that? The main issue I can ...
1
vote
1answer
34 views

`sudo -u user script` does not even have access to /bin/sleep

When running the script bla with sudo -u otheruser ./bla I get an output indicating that this script is run such that no external commands are available: otheruser ./bla: line 3: /bin/sleep: ...
4
votes
1answer
950 views

How to add myself to sudoers when I have no root access on my debian machine?

I've gotten myself into a weird situation. I just installed Debian on a virtual machine I made so that I can ease into it before I try dual booting. I went through all the set up, and as a test to see ...
0
votes
0answers
15 views

notify-send not showing when executing with sudo [duplicate]

In short: I have a scripting finding, fixing and mounting a partition, thus this needs sudo / su permissions. System: Gnome 16.04 - amd64 notify-send "a message" shows a notification as expected, ...
1
vote
3answers
47 views

Does it make sudo more secure when indexing all commands by their SHA-2 checksums?

I'm asking myself whether system security substantially increases when I generate a security policy, i.e. sudoers file which contains one or more Cmnd_Alias definitions that enumerate all executable ...
0
votes
1answer
29 views

2 factor login for gui and ssh imposes verification for sudo use

tldr: how can I make it so I don't have to use a verification code to sudo? Hello, I followed this guide on how to setup 2 factor login for my debian install. I have it so when you try to login ...
1
vote
1answer
69 views

What to do if the owner of /usr/bin/* changes to a non-root?

It would be the right thing to say that I messed up! Accidentally, I changed the owner of all files in /usr/bin to 'dev' from 'root'. Now, sudo does not work! If I use sudo with any command, I get - ...
2
votes
1answer
39 views

Forwarding X-windows through a su - session

I'm trying to forward my X windows, but seems to be limited to just on session? What I'm trying to do is invoke x-applications as another user, through a sudo su -. If I know the other user's ...