sudo - Execute a command with superuser privileges.

learn more… | top users | synonyms

0
votes
0answers
6 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 script checks for the presence of a certain file it needs to use: if [ $EUID != 0 ]; then if [ -f "/foo/bar" ] ...
1
vote
0answers
29 views

How to send sudo password over pipe?

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" ...
7
votes
3answers
496 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
0answers
25 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....
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 ...
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 ...
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
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 .....
2
votes
0answers
6 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 ...
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 ...
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
53 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
44 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 ...
-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 ...
-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 ...
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
1answer
59 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 ...
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:...
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
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 ...
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 &...
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 ...
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
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, ...
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 ...
2
votes
1answer
38 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 ...
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
3answers
60 views

I'm a sudoer and also NOT in sudoers file somehow?

I'm trying to run sudo apt-get update. I will paste my last output from me trying to 'add' myself to sudoers file (which I figured I was on, but kept getting errors saying I wasn't...) timothy@AMDx6:...
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 - ...
0
votes
1answer
37 views

How to forbid ssh connection after sudo -u

After ssh login, user with UserName makes $ sudo -u localusername -i and $ ssh localusername@someserver How to forbid ssh localusername@someserver for UserName via sudo -u localusername but permit it ...
0
votes
1answer
16 views

Default audio (Pygame.mixer and alsamixer) doesn't work when using sudo

I have a simple python file which plays a sound: #sound_test.py import pygame #init sounds pygame.mixer.pre_init(44100, 16, 2, 4096) pygame.init() pygame.mixer.init() WAV = pygame.mixer.Sound("...
2
votes
0answers
18 views

Override local sudo defaults using sss or ldap

I'm trying to to configure an IPA domain to use the following sudo options for a specific command group: !authenticate !requiretty visiblepw Locally, the following defaults are set in /etc/sudoers: ...
1
vote
1answer
13 views

Setting nano cursor using mouse via putty doesn't work if sudo

I needed to be able to set the cursor using mouse when editing text via nano over putty. I have already set the below in ~/.nanorc: set mouse If I start nano file just like that then it works, but ...
0
votes
1answer
36 views

su to a specific user only if requesting user is in a specific group

I need to know how to set up a control user that a user can sudo into only if the user is in a certain group. For example, stupid is a control user that interacts with a service, and is in the group ...
0
votes
2answers
77 views

How to get sudo access without reboot? (on remote server) [closed]

(From remote Debian server) When you give sudo right with visudo for the first time on first boot to a new user, su - <newuser> will not be enough to offer the right to use sudo and then reboot ...
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, ...
2
votes
1answer
51 views

Prevent sudo user access to specific folder and files [duplicate]

How can I restrict sudo access to a specific user in the /var directory or its contents?
0
votes
0answers
22 views

authenticate commands using pam module

This is weird requirement i am not sure possible or not but we have Centrify running in our environment which use dzdo instead of sudo Now i have requirement to ask password for specific command, do ...
0
votes
1answer
27 views

Now visudo won't work at all

RHEL 5.10 When I do visudo I get this error: chuck 75->visudo visudo: /etc/sudoers: Permission denied visudo: /etc/sudoers: Permission denied Listing of sudo exe file and /etc/sudoers: chuck ...
2
votes
1answer
143 views

RHEL sudo still not allowed for user 'tina' [duplicate]

I'd like 2 users, 'tina' and 'lu' to execute a few utils like /bin/chmod. Here's the relevant portion of my /etc/sudoers file. tina,lu ALL=/bin/chmod /bin/chown /bin/chgrp Then I logged in as ...
1
vote
1answer
40 views

RHEL How to login as different user from shell?

Redhat Enterprise Linux 5.10 (No we can't upgrade.) This is related to my other question. I would like to be able to login as another user, like 'tina', so I can test her sudoer permissions. My ...