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

0
votes
0answers
8 views

How to automount in ChromeOS? Biggest partition not mounting at startup on my Chromebook

I was pretty excited to realize there's a Chromebook tag on here on SuperUser, very cool! Not finding this answer on SO or SU or after a lot of Googling. Question is: My biggest partition (9Gb) ...
0
votes
1answer
24 views

Corrupted sudoers file preventing me from using sudo

I attempted to add another user to the sudoers list on my Raspberry Pi running Debian (Raspbian Jessie kernel ver 4.1). While doing so I entered the entry in wrong and I keep getting these errors ...
0
votes
1answer
39 views

Is there a way to set up a warning before executing some commands in the terminal?

There are some terminal commands that are proficient at destroying large swaths of data very efficiently. Like: sudo rm -rf /* or rm -rf /*. I want to set up a warning that will show up, whenever ...
-1
votes
0answers
14 views

Iptable entry gets vanished in an hour in oracle linux 6

I carried out the following steps to create a port-forwarding rule: sudo iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 443 -j DNAT --to $ipaddress:10443 sudo iptables -A FORWARD -p tcp -d ...
1
vote
1answer
15 views

How to sudo using another user's account password from a script?

I have a bash script running as user, a user account with no evaluated privileges. The machine has a second account admin which has sudo privileges. There is no root password set. The script knows ...
0
votes
1answer
13 views

sudo ssh-add /root/.ssh/id_rsa return error

I m trying to save ssh authentication with the command ssh-add for sudo usage: linux$ sudo ssh-add /root/.ssh/id_rsa Could not open a connection to your authentication agent. but as indicated it ...
-1
votes
1answer
22 views

WinSCP/PuTTY: Cannot move file on server via sudo: Permission denied

I have uploaded a file to a remote Linux server. current directory is: /home/user/file.war Now i want to move the file into tomcat webapps folder and overwrite the existing version: The directory ...
1
vote
1answer
39 views

Have output of 'sudo' script printed to same Powershell window?

I found this 'sudo' script online: function Elevate-Process { $file, [string]$arguments = $args; if([System.IO.File]::Exists("$(get-location)\$file")) { $file = ...
0
votes
1answer
67 views

Error executing remote commands with ssh using sudo user

The following command is failing: ssh -t user@server-01 sudo -iu suser "cd /opt/jboss ; ./portal.sh stop" I getting: bash: ./portal.sh: No such file or directory How can I change directory ...
1
vote
2answers
63 views

Problems with sudo privileges as admin in OSX

I am a admin on my Mac with OSX and I have enabled root user. When I try to use the terminal without typing sudo it does not seem to recognise my privileges as an admin, but it works fine if I type ...
3
votes
1answer
67 views

Add user to SSH group safe?

I want to control who can log in via SSH on my server. Is it safe to add the group 'ssh' to the users who are allowed to login in? I see some distros use system groups in the user's ID and others ...
0
votes
1answer
60 views

sudo to any user without a password

If sudo can be configured to no password such as: bob ALL=NOPASSWD: ALL Then how can you configure sudo to be able to sudo to any user without password ? So that sudo -u domainnameuser.com mkdir ...
0
votes
0answers
25 views

Subversion sudo svn update changes file ownership and rwx

I'm limiting permissions on a certain file, settings.py in my svn-linked directory so that it can only be read by sudo users and apache, which goes by the username, www-data. So, on settings.py, I've ...
1
vote
0answers
16 views

Run script as certain user — depending on group membership

I'm trying to run a script which calls another server through SSH (through Pub/Priv key). However depending on the user (or better said, his/her group membership) who runs the script through sudo, I'd ...
1
vote
1answer
40 views

What other than login and sudo is a Linux password for?

I've got a Linux development machine on which I've given some people key-based ssh access (password login is disabled). The users I've given access do not have sudo rights. So today I was wondering, ...
1
vote
0answers
21 views

Stuffed up sudoers file

I have managed to stuff up my sudoers file and am locked out of my server. Is there any way to get back in? To be precise, I have a single user (call her jane), who used to have sudo privileges for ...
1
vote
0answers
12 views

How do I break out of /home/reveller?

Ubuntu newbie here. I succesfully installed Ubuntu on a VM on Windows. I am now trying to run a localhost website using nginx. I have read tutorials online on how to create your website in /var/www ...
0
votes
0answers
57 views

Bricked my Ubuntu server can no longer start nor login anymore

I installed a virtual host (KVM) with Ubuntu Server 14.04.3 LTS. Now I spend the last week setting up apache, modules owncloud and other stuff. However, everthing worked great until I followed the ...
0
votes
0answers
40 views

I can't be root

My school gave me a dump with different partition, I have to Work on the linux one, it's a open suse modified by the school.. sometimes I need to be root for install stuff with zypper example, they ...
0
votes
0answers
18 views

Startup script launched with password-less user fails

I created a user with a password, installed an application with this user, then removed the password passwd --delete bower. When starting the following script using sudo start myscript the error ...
0
votes
0answers
9 views

How to run adb as super user in ubuntu

I have android platform tools which has adb. I know how to run commands on terminal but I don't know how to run an adb file (which is inside that platform tools folder) as super user.
5
votes
2answers
407 views

Why should I really disable root ssh login?

I always read I should disable root login for SSH and login with a user which has sudo. But where is the difference between: ssh root@vps and ssh myuser@vps sudo -i I don't have physical ...
1
vote
0answers
51 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 ...
0
votes
1answer
72 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
57 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
1k 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
12 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
161 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
19 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
23 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
22 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.
0
votes
1answer
56 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
41 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
48 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
31 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
47 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
0answers
871 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
41 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
19 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
42 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
33 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
101 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
37 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
127 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
150 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
55 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
60 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
69 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
180 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 ...