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

2
votes
3answers
83 views

Using su - (user) to open privileged port not working

So I wanted to run a Node server on port 80 but I didn't want to run the entire process on root privileges, for security I thought this would be the best. So I thought a good solution would be to use ...
1
vote
0answers
28 views

Is there anyway you can restrict users from executing a command with another name?

I'm not asking an obvious question here. I would like to elucidate with an example. A user 'bob' is always executing 'chmod 777 /home/bob/impfiles' so that user 'alice' could make changes to the ...
1
vote
2answers
39 views

Running Screen after switching users

After switching users (with su) I cannot run screen: % screen -L Cannot open your terminal '/dev/pts/5'. How can I run screen after switching users?
1
vote
0answers
21 views

Can't resume editor running as root

For years, when I have been working over an SSH connection, I will run sudo vi ... to edit a config file. If I need to do something on the command-line, I'll hit Ctrl+Z to suspend the editor, do ...
0
votes
1answer
20 views

sudo ssh asks for passphrase when it shouldn't

I am able to ssh user@remotemachine without password using a keypair with an empty passphrase. However, when I do sudo -u user ssh user@remotemachine it keeps asking for a passphrase. Also sudo -u ...
0
votes
1answer
24 views

Stuck on password even though used --disabled-password option in ubuntu

I created a user in aws ec2 with: ubuntu$ sudo adduser --disabled-password user1 per instructions from: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/managing-users.html After I ssh in as user1 ...
-1
votes
0answers
16 views

How does sudo decide whether a command is only executable by sudoers with ALL rights? [migrated]

I just wondered why on a Debian system with sudo installed a default user can execute ls but not ifconfig since the binaries do have the same rights: -rwxr-xr-x 1 root root 114032 Jan 26 2013 ...
0
votes
0answers
40 views

Script for temporarily disabling internet connection

I want to block internet connection to me for about 8 hours or so on my Linux machine. I have no will power, so simple call for ifconfig down ifconfig up or similar commands doesn't apply to me, ...
0
votes
1answer
24 views

Are there downsides to installing node.js with root privileges?

I'm using the following code to install node: cd /usr/local/src/ wget http://nodejs.org/dist/v0.10.25/node-v0.10.25.tar.gz tar -xvf node-v0.10.25.tar.gz cd node-v0.10.25 ...
0
votes
0answers
14 views

How to restore Debian server's /var/lib datas

I made a big mistake : While administrating and making settings, I accidentally deleted /var/lib folder. The result is that I can no longer use any dpkg commands, so I"ve lost my mysql database. I of ...
0
votes
0answers
15 views

Application not themed when run with gksu instead of sudo

Slightly nitpicky, but when running applications on Linux Mint 17 from a terminal using "sudo", the application gains root privileges and is nicely themed. If I use "gksu" or "gksudo", the application ...
0
votes
0answers
16 views

CentOS 6 Getting Sudo to show the display in a FreeNX session

My platform is a 32-bit installation of CentOS 6.4 with a gnome desktop and the FreeNX server. When I log into an NX session (usually using NoMachine NX Client), and then try to open an application ...
2
votes
3answers
57 views

Why is this sudo command try to run in /root?

I try to run a sudo command via SSH like this: ssh domain.com sudo -u user bash -c "cd /home/user/ && ls" (which is obiously just an example). I get back: /home/user/: line 0: cd: /root: ...
0
votes
0answers
30 views

“qemu-nbd --create” without sudo

I'm working on a custom OS, and the make recipe I wrote for creating a new disk image requires sudo for connecting/disconnecting the virtual HDD image to a /dev/nbdN device. Because I don't want sudo ...
1
vote
1answer
11 views

Disable an #include instruction in sudoers

Can a sudoers #include instruction be disabled with an additional # character? Or rather just delete the leading # character? (I wish I would understand what the sudo developers had on their mind ...
6
votes
5answers
190 views

Preventing malware from sniffing the sudo password

I often hear people citing sudo as one of the main barriers to malware infecting a Linux computer. The most commen argument seems to go along the lines of: Root privileges are required to modify ...
0
votes
0answers
22 views

Fedora 20: sudo hangs in rxvt-unicode

It seems to be an old problem that the sudo command hangs around 10secs before allowing you to enter your password when executing a command: ...
-1
votes
1answer
52 views

alternatives to insecure sudo?

How do I protect my environment from sudo erasing half of it? It seems I can protect variables, but functions that the variables (like the prompt, for example) rely on are undefined. This means that ...
0
votes
0answers
17 views

path setting appears twice in env output

After an OS version upgrade I have the following strange problem: % port MacPorts 2.3.1 ... % sudo -i # port MacPorts 2.3.1 % sudo port sudo: port: command not found Furthermore, if I do it all ...
0
votes
1answer
41 views

ubuntu superuser got corrupted

I was trying to save times to type password for sudo because one of my scripts had to be randomly repeated quite often. I googled some information about how to bypass typing password and applied to ...
1
vote
1answer
17 views

execute script with sudo and check security

I have a script, which I need to execute with sudo. #!/bin/bash cp "$@" /destionation/dir Is it a good script or someone can bypass the restriction destination dir ? Thanks for suggestions.
0
votes
0answers
8 views

Where to add a new sudoer in vCenter?

Currently, in vCenter, I clone new VMs using an Ubuntu 14.04 template and a SimpleLinux customization spec. I now need to add a new user (newuser) and configure it to be a sudoer in /etc/sudoers like ...
0
votes
0answers
21 views

Trying to rsync and use sudo on other end

Scenario: Mac OS X Machine - old computer - user: john.doe Mac OS X Machine - new computer - user: john.doe Goal: Copy /Users/john.doe/Desktop and /Users/john.doe/Documents via rsync Problem: ...
-1
votes
2answers
27 views

trying to login automatically into a server using sudo ssh cmd in script [closed]

I am new to Shell scripting. I want to login to a server using a script. The normal command I use is --> sudo ssh . when i tried putting this into a txt format file and tried running, it throw an ...
0
votes
1answer
52 views

sudoedit: why use it over sudo vi?

According to the man page: sudoedit /etc/file creates a copy of the file, opens it as the current user, and when saved overwrites the existing file with the copy. whereas sudo vi /etc/file ...
0
votes
1answer
53 views

TC command via webpage as a sudo

The main goal- run a tc command via webpage, starting with: tc qdisc del root dev eth0 (deletes all the filters) Following Simple linux commands from a webpage I am trying to add a tc command, but ...
0
votes
0answers
29 views

Broken sudo commands

How to repair sudo to use standard commands? I cannot use any command with sudo.
1
vote
0answers
61 views

How can I redirect OS X dtruss output when running with sudo?

I'm running dtruss on Mac OS X 10.9. Simple example is: sudo -c ls But I'd like to capture the dtruss output into a file. I saw something that suggests that I can do something like: sudo bash -c ...
5
votes
4answers
183 views

Terminal: prefix previous command?

Frequently in Terminal (though I fully expect any answer will work in bash and most others), I type some command, and then get some sort of permission error due to missing sudo. Okay, so press 'up', ...
0
votes
0answers
2k views

sude gedit Gtk-WARNING **: cannot open display:

I have a VPS on which I am attempting to install pure-FTPd via a root SSH account on a remote machine. I have already installed gedit and have gotten to the stage where I need to edit a config using ...
0
votes
0answers
23 views

sudoers: allow users to remove from their home directory

I'd like to add a sudoers rule that says users are allowed to remove files from their home directory , but I don't see any way to limit arguments to be a subdirectory of the users' home. Is there any ...
0
votes
1answer
43 views

Why does a double sudo modify permissions?

Context: sshed into an AWS t1.micro instance running Amazon Linux 2013.09, using the default ec2-user. I'm trying to list the contents of the default postgresql directory: What's in there? $ ls ...
23
votes
5answers
2k views

Sudo vs root; any actual differences?

I'm working with a support member for a product, and he insists that I need to be root to install a series of patches, and that sudo won't work; he doesn't provide a reason but seems very firm in his ...
0
votes
1answer
68 views

Permission denied on sudo remove

I have two users userA and userB. userA has permission over a file named cache. I want to give permission to userB to remove the file. I have made following entry in /etc/sudoers file : userB ...
1
vote
3answers
46 views

Add a sudoer non-interactively from command line

(On Centos through Docker) I know that I can add a sudoer using visudo. Is there a way to add a user to the sudoer list straight from the command line, so I don't have to do it interactively? I'm ...
1
vote
2answers
75 views

Security risks using SUDO in TERMINAL on MAC

I'm very new to using Terminal and anything like that and stupidly followed an article that uses Terminal with the SUDO command. The sudo command basically loaded a file which updated my ...
2
votes
2answers
129 views

Issue with environment variable

Please help me running below command from user2 account. I cannot figure out what's the issue with this. [user2@localhost bin]# sudo -u user1 /opt/Tomcat/bin/shutdown.sh Neither the JAVA_HOME nor the ...
0
votes
0answers
70 views

Can't sudo when logged in with ssh

I set up a ubuntu machine on my local server. I've got a user with sudo privileges (same password as for login). I've got passwordless ssh going by putting my rsa public key on the ubuntu machine. So ...
0
votes
1answer
79 views

Run startup script with another user

I have two users user1 and user2. And tomcat has owenership of user1 and started with user1 only. I need to make a rule for user2 such that user2 can starts/stop tomcat but tomcat should always be ...
1
vote
1answer
66 views

Understanding implications of sudo -u -H

I'm trying to install gitlab from this guide on Ubuntu 14.04 Server. It is also worth mentioning that I'm behind a http proxy. I'm having problems with this line in particular: sudo -u git -H git ...
1
vote
2answers
191 views

Limit user to execute selective commands (Linux)

How can I limit my user to execute selective commands only. I have a user tomc in tomc group. I need this user to be sudo user and then to have restricted bash. I have tried following code in ...
0
votes
0answers
25 views

sudo ENV_KEEP not always preserving

When I run sudo -s, my environment is preserved. However, when running a simple sudo <command> it appears not to be preserved. The contents of my sudoers file: mafro@ip-10-xx-xx-250:~ > ...
0
votes
1answer
58 views

Sudo as www-data, unable to cd

I have a .procmailrc setup which pipes emails into a script. The core of my problem is that the email is received as user 'magic', and the script that I need to process the email needs to be run as ...
0
votes
0answers
512 views

SU : Permission denied /bin/sh

I added a new user in system: $ useradd new_user When I try to switch from root to new_user, I get this error: $ su new_user permission denied /bin/sh $grep new_user /etc/passwd ...
2
votes
3answers
199 views

What exactly do the sudo -s command? and how is it used in this example?

I have the following doubt. In a tutorial related to a software installation that I am following say that I have to execute the following commands (I am doing it into an ssh shell, so this list of ...
0
votes
1answer
454 views

Python2.7 / Pip2.7 install in Centos6: root does not see /usr/local/bin

I am trying to install Python2.7 in Centos 6. It's a pain as centos6 ships with python26 and yum is dependent on it. Furthermore yum does not seem to have python2.7 I ended up building it from ...
6
votes
3answers
4k views

Running docker as sudo

I installed boot2docker and the i run ./boot2docker start export DOCKER_HOST=tcp://localhost:4243 so i started the tutorial from their docker site. I don't understand one thing: when i run ...
0
votes
3answers
158 views

Setting node path and allowing to run as sudo

I've got a raspberry pi that I'm running node on. I followed this guide http://joshondesign.com/2013/10/23/noderpi to install node. When I setup the NODE_JS_HOME, I can run node from the command ...
0
votes
1answer
59 views

How can I install my script into the user's $HOME/.bin (or $HOME/bin) directory and make sure that is in their PATH?

Edit: places where I said $HOME/.bin I should have written $HOME/bin or any equivalent is fine. So I have a bash script which I am distributing as a client for my API. Current version installs like ...
0
votes
0answers
57 views

User has Sudo access locally but not remotely

I've got a Ubuntu desktop installed as a vm on Windows 2012 server. I've installed Likewise Active Directory to allow domain users to log into the machine with Windows credentials. In my sudoers file, ...