sudo - Execute a command with superuser privileges.

learn more… | top users | synonyms

0
votes
1answer
40 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, ...
0
votes
0answers
13 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 ...
1
vote
4answers
55 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 ...
13
votes
6answers
23k views

Is there a way to stop having to write 'sudo' for every little thing in Linux?

I'm a newbie when it comes to Linux. I do most of my development in a Windows environment. That said, I'm going to be doing a fair amount of PHP work shortly, and I'm interested in learning RoR, so ...
3
votes
2answers
45 views

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

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
49 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
65 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 ...
40
votes
5answers
10k views

Why doesn't the sudo command need the root password?

I've been using Linux for a while now and whenever I typed sudo I thought I was switching over to the root user for a command. Apparently this is not true because all I need is my user account's ...
73
votes
4answers
76k 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?
0
votes
1answer
24 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} ...
2
votes
1answer
2k views

How do I change file/directory permission of a nfs mounted directory, so I access files as user?

On a Ubuntu computer I mounted a directory from another computer using the following line in the fstab: 12.34.56.78:/space/Images /mnt/space/images nfs rsize=16384,wsize=16384,rw,auto,nolock 0 0 ...
8
votes
4answers
7k views

Vim Error E138: Can't write viminfo file $HOME/.viminfo!

I'm afraid I've run into something rather strange. When I open a file normally, vim README.txt, everything is fine. But upon sudo vim README.txt, the file renders blank, and gives me a E138: Can't ...
-1
votes
2answers
69 views

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

Just curious about why super user is ran and not super user do.
0
votes
1answer
965 views

Webmin administrative panel options are missing

When I log into Webmin, with the Ubuntu administrative user frank, I cannot see most of the administrative options: frank is shown as the Administration username in Webmin. I accidentally ...
0
votes
2answers
40 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
90 views

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

In bash (Ubuntu) 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 the options related ...
3
votes
2answers
42 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
19 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 ...
3
votes
0answers
988 views

Security of xhost (local) and sudo xauthority forwarding

Context: launch a GUI application as a linux service. I considered making a headless daemon with a GUI front-end but there is too much code involved to do it now. This service must start on user ...
1
vote
2answers
42 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 ...
1
vote
1answer
29 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
27 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
33 views

How do you sudo with xonsh?

I get the error xonsh: subprocess mode: permission denied: sudo.
0
votes
2answers
23 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 ...
2
votes
1answer
462 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
0answers
18 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 dont want to become superuser, sens I still want to be asked for the password in such cases. I just dont want to wright ...
1
vote
2answers
598 views

Grant account permission to check service status

I've created a new account svchk and via visudo granted it permission to run the following command /sbin/service postfix status: Cmnd_Alias POSTFIXCMDS = /sbin/service postfix status svchk ALL = ...
0
votes
0answers
20 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 ...
5
votes
1answer
897 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, ...
2
votes
4answers
4k views

Allow paswordless user to change to another passwordless user

I have two users dev and tomcat neither of them have a password. How can I allow dev 1 do su - tomcat without having him having to enter any credentials? 1 connects with ssh keyfile
26
votes
2answers
13k views

su vs sudo -s vs sudo bash

What is the difference between the following commands: su sudo -s sudo bash I know for su I need to know the root password, and for sudo I have to be in the sudoers file, but once executed what is ...
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 ...
1
vote
1answer
25 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
40 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 ...
43
votes
4answers
2k 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 ...
2
votes
3answers
197 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 ...
2
votes
1answer
45 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
37 views

Running Deamon Involving GPIO on Pi

I have a deamon 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 deamon is always running, ...
1
vote
1answer
19 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 - ...
16
votes
1answer
2k views

What's the difference between sudo su - and sudo su --

When I am working on our RHEL machines, I use sudo su - to switch to being root. One day, a typo meant I typed sudo su -- instead - it seems to me that everything was the same as with a single hyphen, ...
8
votes
1answer
102 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 ...
8
votes
5answers
15k views

How to get back sudo on Ubuntu?

I have done this: sudo chown -R myname /usr/ and now I can't use the sudo command because of this error: sudo: must be setuid root And as I read this means that the owner of this file ...
6
votes
4answers
491 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. ...
9
votes
7answers
7k views

How do I suppress dd output?

I have a bash script that creates some file using dd. The problem is dd throws a great amount of output that is going to mess with the output of my script. Searching around I've found a solution: dd ...
1
vote
0answers
79 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 ...
3
votes
1answer
93 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
2answers
81 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 ...
0
votes
0answers
40 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 ...
5
votes
1answer
295 views

Edited sudoers file with text editor - now can't run sudo

I now know that I should never try to edit the etc/sudoers file with a regular text editor. However, minutes before I learned this, I saved a new user name in the file with Sublime Text. Now when I ...
1
vote
3answers
5k views

How can I scp a file that my user can't read but I can sudo?

Can I use scp to copy a file from a remote server which my login user can't read, but where I have permission to sudo to root (without password even)? How?