The sudo command is a program for some Unix and Unix-Like operating systems, that allows a user to execute programs with the security privileges of another user. Typically those of a superuser or the root user.

learn more… | top users | synonyms

1
vote
0answers
60 views

Installing SSL on Shared hosting server

I have beta invitation of letsencrypt.org I followed there documentation here . But i am unable to install there packages because i have shared hosting server which does not allow to use sudo ...
-1
votes
1answer
115 views

How do I run a command as another user?

I’m using the following version of Linux [me@ip-99-99-99-99 myproject]$ uname -a Linux ip-99-99-99-99 99.99.99-99.99.amzn1.x86_64 #1 SMP Mon Sep 14 23:20:33 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux ...
2
votes
1answer
130 views

Whitelisting commands a user can use with sudo

I've been attempting to set up a whitelist of commands a user can run on my system. The server I'm using is running CentOS 7. What is the syntax that should be used to only allow a certain group of ...
1
vote
0answers
2k views

“sudo: no tty present and no askpass program specified” error

I am getting "sudo: no tty present and no askpass program specified" error while executing command like "sshpass -p password ssh user@remote sudo ls". Can one help me out... I tried it over few PCs. ...
0
votes
0answers
29 views

Configure non-root to umount any subdirectory

I know that it can add something like hatman ALL = NOPASSWD:/bin/umount /a/mount/point/directory to allow the user hatman to call sudo /bin/umount /a/mount/point/directory BUT... What I really ...
4
votes
2answers
216 views

Reboot EC2 Amazon Linux (Redhat-based) from script

I would like to reboot my Linux from a Script. The script does not run as root. Using sudo reboot produces sudo: sorry, you must have a tty to run sudo. A plain reboot gives the error ...
0
votes
1answer
25 views

php-cgi causes permission denied on output file despite appropriate permissions

I am trying to run a php script using the php-cgi. The command is: sudo -Hu apache /usr/bin/php-cgi -f /var/www/html/load.php >> /var/www/html/load.log The output is: -bash: ...
0
votes
0answers
29 views

How to Configure Sudo to Preserve Group and User IDs as Owners?

Question I am running sudo 1.8.15 on Ubuntu 15.10 (wily). The last two entries in my /etc/sudoers file are: Defaults:nginx stay_setuid,targetpw,env_reset nginx ALL=(ALL) PASSWD: ALL But, when I ...
0
votes
0answers
23 views

How to prevent sudoers from deleting other sudoer users in Ubuntu?

There are two sudo users on an Ubuntu machine. I don't want one of them to be able to delete the other users. But I don't want to disable second user's sudo privilege.
-1
votes
1answer
68 views

How to Temporarily Suspend Security Policy Checks / Or Temporarily Grant Root Access?

Note: Please feel free to edit the question -- I am having a hard time expressing it! Question: How do you impersonate a regular user--while still retaining admin/root privileges to execute any ...
0
votes
0answers
69 views

Sudo: allow group of users to su to users defined in user alias

I need to setup sudo to allow any user from group webadm to su or su - to a number of users defined in particular User Alias. Each user from webadm group shoud be able to su only to defined users, ...
0
votes
1answer
61 views

Sudo can't see symbollically linked executables in path

On CentOS 7, I installed some executables in /opt/app-version/bin/executable. Those executables have the following permissions: rwxrwxr-x. 500 500 Ownership of every directory in the path ...
1
vote
1answer
41 views

Why doesn’t “sudo -n true” work inside brackets in loop/conditional?

I have a loop that will prompt for the sudo password until it gets it correct. The why isn’t relevant, lets just say it’s part of a bigger script and other solutions aren’t appropriate. until sudo -n ...
0
votes
0answers
51 views

Sudo not working when Downloading Sockets.IO?

When I run the command: npm install socket.io I get a long line of problems (they repeat many times, this is one) Agreeing to the Xcode/iOS license requires admin ...
1
vote
1answer
2k views

error: XDG_RUNTIME_DIR not set in the environment. Gtk-WARNING **: cannot open display:

I used to open text files with sublime, and for Read-only files, I used to do : sudo sublime. But now just suddenly the sudo sublime command gives the following error : (sublime:3931): Gtk-WARNING ...
0
votes
3answers
58 views

Sudo feature in zsh

I am using zsh on my Linux boxe as well as my MAC. However, in both env, I have a "problem". When I type " !! ", it does not work in zsh, but does in bash. More, it's really useful with "sudo !!". ...
0
votes
1answer
27 views

sudo not able to access private key

I have a public-private key pair at ~/.ssh being used for SSH connection to GitHub. In order to test if I've setup SSH with GitHub properly, I used ssh -T git@github.com, which works fine. Also, ...
0
votes
1answer
50 views

My application runs as sudo, how do I make it git pull using my user's credentials?

I run my application as sudo but I need it to use a git pull based on the information in ~/.gitconfig and ~/.netrc files my current user has. How do I do this without putting my credentials in the ...
0
votes
0answers
53 views

how to chain sudo/su and still benefit from sudoers config

I have two users that can sudo some commands without password (to simplify, lets assume they can run sudo ALL) # /etc/sudoers userA ALL = (root) NOPASSWD: ALL userB ALL = (root) NOPASSWD: ALL ...
0
votes
1answer
138 views

Why does htop on Mac OS X require root privileges to see data for all processes, but on Linux it runs without root

I use htop all the time when I'm working on Linux system. I've installed htop-osx through Homebrew on my Mac, but in order to see all data for all processes, the recipe tells me that I need to run ...
1
vote
2answers
41 views

Honor aliases when using sudo?

I have two aliases set up in my .bash_profile. I want sudo to honor both of them: $ cat ~/.bash_profile export EDITOR=emacs ... alias yum="dnf" alias ssh="ssh -2" ... I know how to tell sudo to ...
1
vote
2answers
205 views

Remove files from a root-owned directory using sudo with wildcards

Let's say I have a folder, /var/log/nginx which is protected (owned by root, and no one else can read or write into it). Even using sudo, I can't do sudo rm -f /var/log/nginx/ab* without getting "No ...
2
votes
1answer
171 views

Are changes to El Capitan's SIP configuration file persistent?

If you toggle System Integrity Protection off to tweak some things, unload daemons, delete apps, etc., will those changes survive toggling SIP back on and re-launching the machine, or will the changes ...
22
votes
1answer
2k views

Why does wget give an error when executed with sudo, but works fine without?

I tried the following command: $ wget -q --tries=10 --timeout=20 --spider http://google.com (From this SO post. I want to check my internet connection in bash.) I get following output: Spider ...
0
votes
1answer
64 views

Ubuntu 12.04 unable to putty or sudo

One particular user is unable to putty or use sudo. The user can login using the VMware console but still cannot sudo. User can change password using passwd user no problem. When the user tries to ...
1
vote
0answers
87 views

Can't use sudo when autologin in Arch Linux

I have a Pandaboard running Arch Linux, the default non root user is alarm. I'm trying to automatically login at startup with the alarm user. I followed the instructions here and created the file ...
2
votes
1answer
116 views

I locked myself out of my AWS machine by changing ssh settings maybe?

I'm not sure exactly what caused the problem but I'll tell you know I know. I created an amazon ec2 instance and was using public/private key authentication to ssh in as the default ubuntu user. ...
1
vote
1answer
257 views

Restrict access to directory with sudo

If I have a folder at /var/secret/ and give a user access to the sudo command, is there a way to allow them to have full access to everywhere else, BUT /var/secret/ and give them absolutely no access ...
3
votes
1answer
150 views

Lost access to sudo on Mac. Want to regain access

I don't know what came in my mind that I just typed this in my shell: sudo chmod 700 /usr/bin/sudo and then also entered my password. The above command ran and I lost control over sudo. sudo is ...
0
votes
1answer
212 views

rsync directories that need sudo permissions on the remote server

I have one local server, let's call it as A, which has access to a remote server. I want to synchronize with rsync a directory from the remote server to the local one, and I want to put the ...
0
votes
1answer
116 views

How do I make vim use the syntax highlighting of another file location?

I don't ever use sudo vim /path/to/some.file; I always use sudoedit. However, this means that vim doesn't see the correct path. As an example, when I open /etc/http/conf/httpd.conf, sudoedit makes a ...
0
votes
1answer
95 views

Accidentally change sudo user to /bin/false

More Update In short, I have to execute a command (sudo nano /etc/passwd) using a Sudoer Account which I know the username and password but I have to login as a non-Sudoer Account trial #1 su - ...
1
vote
2answers
842 views

Run `sudo` command at startup/bootup on Mac OS X

How to run a sudo on command line when a Mac startup? Specifically, I'm trying to run the following line on Mountain Lion: sudo ipfw add 100 fwd 127.0.0.1,8080 tcp from any to any 80 in There are ...
2
votes
1answer
116 views

Auto source a script after sudo su

I am working on a machine that has some user accounts that are dynamically generated, and therefore I can not user customize the .bashrc or .profile. I frequently need to use these accounts to change ...
0
votes
1answer
35 views

Set a specific password for sudo

Would it be possible to set a password different from the user one and the root one? I find that asking for the user password kind of useless and the root one, even more, just give him the root ...
0
votes
0answers
19 views

Switch to user2 and load user1's bashrc automatically?

I want to switch to user2 from user1 and then instantly load user1's bashrc. For example: sudo su user2 And then as user2 run this cmd: source /home/user1/.bashrc I'm aware that maybe I shouldn't ...
0
votes
0answers
25 views

What is the best way to create a local development environment in a linux machine without being in sudoers

I use a workstation for my development but it does not include all the libraries for my case. I like to install them for my use without any system wide effect. How should I proceed this is a linux ...
1
vote
0answers
33 views

How do I get the sudo permissions to enable root from Terminal?

I have an MacBook Pro constructed in mid 2014. I do a lot of work on it, and my son does his gaming on it, but when I upgraded to OS X Yosemite, my account (which was the administrator) got demoted to ...
0
votes
1answer
68 views

How to download file from remote server to windows without sudo

I have a VM running Ubuntu 14.04. I seem to have broken sudo on my account: sudo: /usr/bin/sudo must be owned by uid 0 and have the setuid bit set I do not have root access. I am looking to ...
0
votes
1answer
49 views

Meaning of parameters in sudoers file in RedHat

HI can you tell me what is the meaning of each and every parameter meaning of this line of sudoers file in RedHat machine? steve CSNETS = (operator) /usr/local/op_commands/ I know first ...
1
vote
0answers
99 views

Restrict an admin user from using sudo on os x

I have multiple admin users on my mac. Is there a way I can block a particular admin user from executing sudo on OS X? My understanding is that if the user name is "abc", abc ALL=(ALL) ALL in ...
0
votes
2answers
85 views

Accessing shell variables inside 'sudo' block : export doesn't work

I am writing a script to fix a missing 'F' letter in a mail log file. The mail log file is continuously updating. I am getting a file name, after that I am doing 'sudo su' to get superuser access. ...
0
votes
2answers
60 views

How to use linux to not get crazy with root privileges

I've got a question for you today my dear Linux friends. I'm a windows user primarily. I use it for my work, watching movies, listening to music, playing games, browsing the net and everything else ...
1
vote
0answers
24 views

Root Privileges and Risky Commands

user ALL=(ALL) /usr/bin/vim /etc/httpd/confs/httpd.conf user ALL=(ALL) /usr/bin/less /etc/httpd/confs/httpd.conf I think if these scripts are written in sudoers, "user" can cause problems on the ...
1
vote
0answers
32 views

sudo --set-home decide based on command

I was wondering if there is a way to make sudo set the --set-home flag based on the command being executed. e.g. in most cases I do not want the --set-home flag to be set, but for npm, I want it to ...
1
vote
0answers
204 views

How to rsync root files over non-root ssh?

I have two machines, both providing no root login, but provide sudo root access. Now I like to initate a rsync transfer of root files over ssh. Is there an easy way make the the root access given by ...
0
votes
1answer
47 views

sudo NOPASSWD for particular paths

How can I enable NOPASSWD for a user to do anything in several paths? For instance read/write/execute any file in /etc/init.d and /opt/?
1
vote
1answer
815 views

How to set path for sudo commands

If I issue sudo my-command how does Linux look for that my-command? The my-command is in my PATH. I can invoke it without any problem. However, when I invoke it with sudo, I'll get command not ...
0
votes
2answers
154 views

Logging into sudo with a hashed password

I am curious as to whether or not I can pass the sudo password prompt the hashed sha512(?) password and log in to root that way. So it might look something like this: [user@device ~]$ sudo su - ...
1
vote
0answers
68 views

Run chromium as different user - Cannot download files

For security purposes, I'm running chromium with a UID different from my main desktop user. user="web" xhost +SI:localuser:"$user" > /dev/null sudo -u "$user" -H -E -s -- chromium With sudo ...