sudo - Execute a command with superuser privileges.

learn more… | top users | synonyms

2
votes
2answers
68 views

Run and stop a monitoring command as sudo for s seconds every m minutes

I want to run sudo airodump-ng -w myfile every ten minutes or so, for m minutes. It does not matter if the running time shifts (that it, if it runs m minutes later each time). Notice that this is a ...
3
votes
1answer
134 views

sudo script - best practice?

I have a script in which some of the commands need to be run as sudo. I have seen it asserted that running sudo inside scripts is a bad idea, and that is is better to run the whole script as sudo (and ...
3
votes
1answer
171 views

Can't give myself NOPASSWD privelege for chmod/chown [duplicate]

I'm trying to set my local computer (which has Linux Mint 13 Maya) so that I can chmod & chown any file with my regular max user account. Following this page, ...
0
votes
3answers
184 views

First bash script - Enter root password only once

I wrote a small bash script. But it needs root password. There are two commands only, both of which need the permission. So, currently I must enter sudo password twice - I don't want that. I linked ...
3
votes
1answer
286 views

How to make a sudo passwordless script for any user in bash

I want to be able to run a sudo command inside of a bash script but I was wondering what if I want any user in my server to be able to execute the script without to provide them with my root password, ...
5
votes
0answers
209 views

allow regular users to use network namespaces

I have an architecture using network namespaces (netns). I would like to allow regular users to do some operations in these netns. I could write a script netns-exec.sh, inspired by this post, ...
6
votes
1answer
329 views

What permissions one needs to run chmod, chown command on a folder/item?

I've always been running chmod/chown commands as a sudo user. But today I wondered if I don't use sudo, what permissions do I need to actually execute chmod/chown command on a folder/file? I've tried ...
0
votes
1answer
89 views

Is it possible to execute a command as another user without sudo su'ing to that user?

I do a lot of administration in CentOS6 for several teams. One of the more frequent things I do is sync down and package code as the team account, before deploying it out under my own account. Is ...
2
votes
3answers
2k views

sudo command doesn't source /root/.bashrc

I have added a custom path to PATH variable in my /root/.bashrc file When i do sudo su; echo $PATH, it shows the entry, '/path/to/custom/bins'. But i do sudo sh -c 'echo $PATH', it shows, ...
0
votes
1answer
147 views

Sudo Apache, with command line ? (not visudo)

I have visudo-edited /etc/sudoers this way: User_Alias APACHE = www-data Cmnd_Alias FIREWALL = /sbin/iptables, /sbin/ifconfig, /sbin/route APACHE ALL = (ALL) NOPASSWD: FIREWALL (To allow php ...
0
votes
1answer
153 views

Linux Sudo Without Password Prompt [duplicate]

I want to run a bash command at startup (~/.config/autostart/myCommand.desktop) that requires sudo, but rather than it prompting me every time, I would like to include the password in the command, ...
1
vote
1answer
331 views

Eclipse does not launch without sudo

On my Fedora (Fedora 22 Workstation) system, I recently installed Eclipse (sudo dnf install eclipse-platform). However, I am unable to launch Eclipse without using sudo. I would prefer not to have to ...
3
votes
2answers
57 views

What is the problem of giving the right to use sudo vim? [closed]

I'm using Mac OX 10.10. I would like to know what problems are caused by this: user ALL=(ALL) /usr/bin/vim /etc/httpd/confs/httpd.conf I think this is in /etc/sudoers. I also have Cent OS. Does this ...
2
votes
1answer
311 views

ldd shows library exists and is linked, program doesn't find it

Console Output: bitnami@linux:~$ sudo svnmucc propset svn:needs-lock 1 file:///opt/bitnami/repositories/Standard/Ipc/trunk -m "test set" svnmucc: error while loading shared libraries: ...
3
votes
2answers
111 views

Why user without any PASSWD entry in sudo config has to authenticate every time?

Consider this sudo config for two users: mary ALL = (ALL) NOPASSWD: /bin/ls, /bin/cat bob ALL = (ALL) PASSWD: /bin/sort Now, when user mary executes any command not in the list she has to ...
1
vote
4answers
139 views

What's the difference between sudo su vs just su?

I see a lot of posts out there that say you type in sudo su to get an interactive prompt with root privileges, and I see equally many posts debating the pros and cons over sudo -i vs sudo su. Here ...
0
votes
1answer
156 views

ssh master - execute su remotely

I have a server S that I need to connect to. I'm connecting to S as user asdf with control master and after that I perform some stuff: ssh -N -f -M -o ControlPath=$SSHSOCKET ${USER}@${IP} -p ${PORT} ...
-1
votes
2answers
302 views

When in debian 8.1 why is the super user run with su not sudo? [closed]

I am curious why the super user command su is run and not super user do (sudo).
1
vote
2answers
947 views

error when adding user to wheel group in CentOS 7

I am trying to grant sudo privileges to a user of a CentOS 7 devbox by typing gpasswd -a user wheel, but the attempt is failing. What am I doing wrong? Here is what I typed: I discovered that ...
2
votes
1answer
445 views

Why root bash output is colored but `sudo ls` output is not?

In bash (I am using Ubuntu 12.04) I get colored outputs either as root (after sudo su) or as a normal user. I checked (after reading this post) the files .bashrc for normal user and superuser and ...
3
votes
2answers
1k views

How to stop sudo PAM messages in auth.log for a specific user?

I am using Zabbix for monitoring my environment and zabbix_agentd executes as user zabbix one custom script every 60 seconds; it uses sudo to run this script as root. In /var/log/auth.log I see every ...
0
votes
0answers
26 views

debian 7 sudo email notification

I edit sudoers by visudo: Defaults env_reset Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" Defaults mailto = "me@domain.com" Defaults ...
1
vote
2answers
351 views

run command with sudo su in script and redirect stdin and stdout

I need to run command as another user and write to its stdin and read from its stdout. I can run command as another user only via opening new shell: sudo su anotheruser but with new opened shell i ...
2
votes
1answer
65 views

make sudoers use their own history file

I just can't seem to get a simple answer to this one. All I am trying to do is get a sudoers to use their own history file, but if I set the history var in the .bashrc for root with $user, the $user ...
0
votes
2answers
197 views

Disable some programs from sudo

I have a group of trusted developers which I have given sudo permissions on a server but I want to be able to exclude some programs to be run with sudo. For example I would like to disable command su ...
1
vote
1answer
188 views

How do you sudo with xonsh?

I get the error xonsh: subprocess mode: permission denied: sudo.
0
votes
2answers
72 views

sudo host field: what is it used for?

syntax for sudo is user ALL=(ALL) ALL whereby: 1st field is the user that can execute sudo 3rd field is the users that can be sudo into 4th field is the commands that can be executed as ...
1
vote
0answers
22 views

Is there a way to automatically use sudo whenever I get “Permission denied”? [duplicate]

Is there a way to automatically use sudo whenever I get "Permission denied"? I don't want to become superuser, since I still want to be asked for the password in such cases. I just don't want to ...
0
votes
0answers
76 views

Multiple here documents in a bash script to drop in and out of sudo is causing error “Sessions still open, not unmounting”

I'm attempting to write a setup script that I can run on multiple machines to run a bunch of installers (requires sudo) but also do things like pull down a git repo (I want to run that as the normal ...
0
votes
0answers
22 views

How can I run a command as root user on Ubuntu? [duplicate]

It seems Ubuntu has disabled the root user account so su doesnt work which is causing me an issue where I have an apache log file that is owned by root $ls -al error.log -rw-r----- 1 root adm 2061050 ...
2
votes
1answer
849 views

User settings for monit? Should it run as root, or it's own user?

I'm trying to install monit on an Ubuntu 12.04 server. I have it set up, and configured (i think), but i'm not sure what user it's supposed to run as. My user on the server is called deploy, and my ...
2
votes
1answer
300 views

How can I use different kerberos principals for sudo than for system-auth?

At my organization, we're required to use different kerberos principals when authenticating for sudo than for other types of auth, such as logging in. For instance, my regular (login) principal might ...
5
votes
1answer
202 views

Running Deamon Involving GPIO on Pi

I have a daemon that monitors various things using the GPIO ports. I have used python to write the code for this using the RPi.GPIO module. I would like to ensure that the daemon is always running, ...
2
votes
3answers
450 views

`tail -n 40 /var/log/apache2/error.log` without `sudo`

Many times during the day I need to inspect my Apache log: sudo tail -n 40 /var/log/apache2/error.log I then have to provide my password. It's a clumsy workflow, so instead I am adding ...
1
vote
1answer
30 views

Does loginuid have any impact on process limits?

On CentOS/RHEL 6, when I start my daemon as root user, I see /proc/<pid>/loginuid of the process as 0 and when I start it through sudo, I see loginuid of the sudo user. Even if I do sudo su - ...
47
votes
4answers
4k views

Is there ever a good reason to run sudo su?

To launch a root shell on machines where the root account is disabled, you can run one of: sudo -i : run an interactive login shell (reads /root/.bashrc and /root/.profile) sudo -s : run a non-login ...
8
votes
1answer
125 views

Why does sudo need the loopback interface?

We were trying to install our software on an Ubuntu machine. To do so, we needed root privileges. Basically, all we needed to do was run a runnable jar like: sudo java -jar runnableJar.jar. All such ...
1
vote
0answers
369 views

Ubuntu 14.04.2 LTS: for NIS users, SSH works but console login and sudo fail

I set up a fresh Ubuntu 14.04 LTS VM on VirtualBox and did an upgrade, so now I'm sitting at 14.04.2. Our office environment is NIS+NFS. I set up autofs and NIS, and confirmed that I can log in as a ...
6
votes
4answers
3k views

Bash, execute command after invoking a new shell

I am trying to make a script like this: #!/bin/bash sudo -s something... When I execute it, I get a new shell but something is executed only when I exit the shell created by sudo -s, not inside it. ...
3
votes
1answer
583 views

Possible to pipe command using su via ssh

I'm trying to write a python script to remotely update the login passwords for a set of account I administer - I can already successfully use python to pipe remote commands via the stdin of an ssh ...
0
votes
0answers
159 views

sudo: setreuid(ROOT_UID, user_uid): Operation not permitted

I get this in my debian wheezy. I do not know what to do. I get it with every sudo command. Su password fails every time. I have seen people suggesting running service ncsd stop and then start it but ...
0
votes
1answer
79 views

Set root password AMI linux

I need to set a password for root on EC2 AMI Linux. I have tried with passwd root but if I log in with ec2-user and run sudo su, I get a root bash without asking for a password.
-1
votes
1answer
82 views

Error while installing wget and unzip

I am trying to install wget and unzip on an Ubuntu machine. But I am facing the issue shown in the screenshot (dependency problems). sudo apt-get install wget unzip
12
votes
2answers
1k views

How do I make sudo remember my password for longer?

How do I make sudo remember my password for longer so that I don't have to keep typing it? I do not want to sudo su and execute commands as root all the time. I am on Arch Linux and have tried to ...
2
votes
1answer
5k views

When I run “sudo su” I get --bash: command not found for everything

I'm not good with command lines or servers. But I needed to configure for work a AMI of EC2 AWS with LINUX So I've installed a lot of stuff, moved a lot of stuff around and then I realized that sudo ...
2
votes
1answer
271 views

Running sudo restricted commands by creating soft link

I have sudo access to one of our test machines and the following are the commands restricted for me: user_sree@sel8585:~> sudo -l user_sree's password: User user_sree may run the following ...
0
votes
1answer
117 views

When I execute a .run file as <user> it works fine. If I sudo run it, it cannot detect Java

I am trying to execute a .run file that will install some applications. I'm installing the application in /opt/... When I run it without sudo, the installer runs correctly but cannot write to /opt/. ...
1
vote
3answers
123 views

Recommended way to install software to /usr/local — use sudo or chown?

I'd like to install software from source (e.g., third-party GitHub repos) to my machine. Generally /usr/local/bin and /usr/local/src are for non-distribution-specific software, right? Taking ...
0
votes
2answers
448 views

root access on new chromeos lenovo n21 for python dev

We've purchased several new Lenovo N21 chrombooks to run Python workshops for inmates in the local jail. Trying to install Crouton, Debian, and Anaconda to prepare. All require developer mode and ...
2
votes
1answer
194 views

Is granting unattended-upgrade command to non-sudo users safe?

I have found out that I give get a non-sudo user access to certain commands with the sudo privileges. However, my plan to allow them to run apt-get dist-upgrade the system is not safe because they ...