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

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 ...
1
vote
1answer
34 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: ...
6
votes
5answers
170 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
8 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 ...
2
votes
2answers
2k views

sudo, runuser, su don't work as I expect when run as root with command as “echo $HOME”

When I run these commands it outputs as shown. /root $ sudo -u someuser -i "echo $HOME" /root $ runuser -l someuser -c "echo $HOME" /root $ su - someuser -c "echo $HOME" /root What i expected ...
7
votes
4answers
15k views

On Mac, how do I give myself permanent sudo privleges?

In Mac OS X 10.6, how do I give myself permanent sudo privleges? is it like linux, in the "/etc/sudoers" file?
5
votes
3answers
2k 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 ...
1
vote
3answers
1k views

Change the sudo su shell

Whenever I run sudo su from my normal zsh (which uses the oh-my-zsh framework), I'm forced to use the old Bourne shell (sh) by default (obviously; this is standard behaviour on most *nix-like ...
0
votes
1answer
198 views

How to a sudo command which keeps all environment variables

Example command is as follows, run as a normal user which python /home/me/env/development/python because the PATH environment contains a path that points out to this instance of python (instead to ...
1
vote
1answer
7 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 ...
4
votes
1answer
347 views

sudo -k vs. sudo -K

I know what the man page has to say about the -K and -k : ‑K The ‑K (sure kill) option is like ‑k except that it removes the user's cached credentials entirely and may not be used in ...
1
vote
1answer
14 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.
-1
votes
1answer
42 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
13 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
vote
4answers
6k views

“sudo nautilus” does not allow changing files or folders

I can't modify files in Ubuntu 12.04. I'm trying to change the permissions so that I can add a folder or change a file and all I get is this: $ sudo nautilus sudo: /usr/lib/sudo/sudoers.so must only ...
0
votes
3answers
528 views

Can't run command with sudo, even with the full path, I got an error

The command starling is located at /home/keating/.rvm/gems/ruby-1.9.2-p290/bin/starling. Only using rvmsudo starling will work properly. This is the result of me trying to invoke it in various other ...
0
votes
0answers
16 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 ...
2
votes
2answers
863 views

Wireshark: Accessing USB Bus Interfaces without sudo

I am trying to monitor some USB traffic using Wireshark on Linux (Ubuntu). If I start Wireshark as my normal user without root privileges, the USB bus interfaces are not listed. If I sudo wireshark ...
0
votes
1answer
41 views

Sudo Cmnd_Alias Optional Arguments

I would like to allow a command to be run under sudo with or without arguements. For example, both of these should work: rm -f /etc/stuff rm /etc/stuff/item.txt To get this to work, I need this ...
0
votes
1answer
28 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 ...
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
18 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: ...
57
votes
2answers
12k views

How to append to a file as sudo? [duplicate]

Possible Duplicate: sudo unable to write to /etc/profile I want to do: echo "something" >> /etc/config_file But, since only the root user has write permission to this file, I can't ...
-1
votes
2answers
20 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
0answers
15 views

Can't get file to copy from /sys/ on rooted Android [migrated]

I'm currently rooted on a Samsung S3 i9300 running a custom rom on Kitkat 4.4.2 I use es file explorer to perform root tasks on directories and files, I wanted to permanently turn off the led lights ...
-1
votes
0answers
24 views

Cannot execute root: No such file or directory

i had a problem when i used "sudo su" and the output was something like this : "Cannot execute root: No such file or directory" i have searched about that but i couldn't find something useful for ...
10
votes
3answers
2k views

How can I properly set sudo/visudo's editor?

I am using Ubuntu 10.04 Server and trying to set up sudoers to respect a user's EDITOR choice (within limits) In my sudoers I have: Defaults editor=/usr/bin/nano:/usr/bin/vim Defaults ...
0
votes
1answer
33 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
286 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 ...
0
votes
1answer
47 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
26 views

Broken sudo commands

How to repair sudo to use standard commands? I cannot use any command with sudo.
2
votes
1answer
4k views

Howto switch / chage user id witin a bash script to execute commands in the same script?

Is there a way to switch user identity within a script (executed as root as part of an installation process) to execute some commands without calling an external script, then return to root to run ...
3
votes
3answers
3k views

Adding a line into the hosts file, getting permission denied when using sudo - Mac

I'm trying to add a line into the hosts file on my Mac by executing a one line command on the terminal. I thought this would be easy using sudo, but it returns "permission denied" when I try to add ...
1
vote
4answers
8k views

Removing MySQL completely on Linux

I'm fairly new to Linux, when I first installed MySQL it was during an LAMP setup on personal machine with a Ubuntu Setup. ATM, I'm trying to get a fresh, clean install of only MySQL. I've been to ...
1
vote
0answers
39 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 ...
29
votes
6answers
24k views

scp to remote server with sudo

I have a file on server A (which is behind a NAT so not directly addressable). The file needs to be copied to server B in a directory restricted to root. I have an account on server B with sudo ...
45
votes
7answers
53k views

sudo with password in one command line?

On busy days, I'd like to run $ ./configure && make && sudo make install && halt on the night and go to bed, hoping the application would automatically be installed. But ...
0
votes
0answers
509 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 ...
6
votes
5answers
15k views

How to reset folder permissions to their default in Ubuntu 9.10?

I recently typed the command sudo chmod 777 -R / after that some things like sudo -i are not working normally. So I am wondering if there is any way I could reset the folder permissions to their ...
0
votes
0answers
20 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 ...
5
votes
3answers
1k views

Logged in to vi, made changes, forgot to sudo first - now what

I made lengthy changes to a configuration file on a Ubuntu Linux computer with the vi editor. Unfortunately, I forgot to sudo first, so now I'm in the editor, but can't save my changes because of ...
0
votes
1answer
38 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 ...
2
votes
2answers
4k views

How to configure sudoers with path wildcards?

I need sudo for a command for any path under a particular area. Example: sudo mycommand /opt/apps/myapp/... What is the sudoers syntax to allow this command to run in any path that falls under ...
22
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
0answers
59 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
49 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
36 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 ...
3
votes
2answers
4k views

sudo: Sorry, user root is not allowed to execute

This command fails on OpenSuSE 11.4: root@host# sudo -S -u "coreapp_customer1_d" -g "coreapp_customer1_d" /bin/bash -l -c "mkdir -p /home/coreapp_customer1_d/.ssh" with this message: Sorry, user ...
1
vote
2answers
51 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
113 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 ...