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
0answers
166 views

Forklift sftp with sudo command?

Is it possible to somehow issue a sudo command while using Forklift to transfer files?
0
votes
1answer
66 views

All the command line command become “Not found” after installing Mountain lion

I just found after installing new Mountain lion, I can no longer use the command line because all the command seems to be " NOT Found", even for basic "sudo" command sudo: command not found How can ...
3
votes
1answer
974 views

How to add CLASSPATH parameters permanently when using sudo?

On Ubuntu 12.04.2 LTS 64bits, when using sudo or sudo -i or sudo su or even su in a session, in order to use both Java AND Scala I need to enter the following commands: sudo -i ...
1
vote
2answers
546 views

Function defined in my user's .bashrc causes an error when I sudo su

I have a function defined in my user's .bashrc file that displays my current git branch name at my command prompt: parse_git_branch() { git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* ...
1
vote
1answer
320 views

launching php script as root from command line

How can I execute php script as root user? I tried: sudo ./script.php and in my script I've got at 1 line: #!/usr/bin/php
5
votes
1answer
449 views

Two password (factor) authentication to root user / sudo

With regards to running Linux remotely (SSH) I'd like to employ two levels of authentication for accessing the system with root privileges. I have the root account disabled / locked out so direct ...
0
votes
2answers
175 views

i want alice to run any command as root, but can not run commands as any other user

Say I have 2 users - 'alice' and 'bob' and want to allow 'alice' to run any command as root, but not run commands as 'bob' or any other user, am I able to do this, and if so how ? consider this ...
-1
votes
2answers
157 views

I can su to root, but sudo <command> fails

I am running Centos 5.3 and I can su to root fine. However when I run a command as another user like: sudo ls, the system says incorrect password for the same password. Why is this happening? Thanks. ...
1
vote
3answers
681 views

Why can I kill a sudo process on Xubuntu but not Linux Mint? (as a normal user)

I have two computers, one running Xubuntu 12.04, and the other running Linux Mint 14. On Xubuntu: $ sudo gedit in another terminal: $ kill [pid of the gedit process] bash: kill: ([pid]) - ...
1
vote
1answer
1k views

Edit sudoers to allow /sbin/ifconfig down with NOPASSWD

I'm trying to edit /etc/sudoers so that I can execute a bash script with a root password. so far every edit I've tried to sudoers is not working. I've tried adding each of these lines: %admin ...
0
votes
1answer
375 views

Expect and sudo timeout

I have a main shell script that prompts the user for his password. I then would like to call an expect script while passing the password to it. This expect script will run 3 sudo commands. I know the ...
4
votes
2answers
503 views

How do I back out of sudo privileges in OS X

Is there a command to de-elevate the user from sudo permissions after I execute a command such as sudo pmset sleep 0 so that when I try to execute another sudo command it asks for my password again? ...
2
votes
2answers
169 views

restore password in ubuntu [duplicate]

I'm learning UBUNTU. I'm using virtual box with ubuntu image, i created my user name as joe no password. now that i try to execute any command that requires the sudo stuff it asks me for a ...
10
votes
2answers
22k views

How to check if I have sudo access?

I recently got into trouble because of this. $sudo vim /etc/motd [sudo] password for bruce: bruce is not in the sudoers file. This incident will be reported. Is there a way to check if I have ...
2
votes
1answer
499 views

Can't use sudo's arguments as non-root in Fedora 16

I am using a long-installed Fedora 16 box, and whenever I type "sudo -v", "sudo -l", etc. as a regular user (non-root), I get this output: [user@* ~]$ sudo -v env: -v: No such file or directory ...
0
votes
2answers
812 views

running script containing sudo in cron

#!/bin/bash value=$(<man.txt) echo "$value" if [ "$value" == "true" ]; then echo "startedif_manthan" ps -ef|grep sym |awk '{ print $2 }'|sudo xargs kill -9; sleep 30; sudo sh ...
4
votes
1answer
935 views

Why does sudo not work with curl?

I ran a command to download something with curl and it threw a permission denied error. So I did sudo curl and I got the same error... Why is that? I was able to run the install command without ...
4
votes
3answers
4k views

Why can't I sudo some commands? (e.g., vim)

I have sudo access on my friends server, running centos-6.3, but when I try to run some commands like sudo vim /var/www/html/index.html I get an error sudo: vim: command not found I can, however, run ...
2
votes
1answer
217 views

Start/stop a service using jenkins/hudson, without sudo

Quick question - did some searching but couldn't seem to find anything. I'd like to be able to stop/start a service on a Jenkins node. Is it possible to give the jenkins user permission for this ...
4
votes
1answer
551 views

sudo -E not passing all variables

Reading the man pages I expected sudo -E to pass all environment variables to the subshell, but I am not getting the expected results. As expected, awesome: $ export ...
0
votes
0answers
90 views

why sudo create directories in wrong permission drwxr-sr-x?

I run sudo on ArchLinux(on x86_64) and Fedora(on sh4 cpu). They behavior different. sudo mkdir x ls -l x It shows drwxr-xr-x root root x on ArchLinux. But shows drwxr-sr-x root mygroup x on Fedora ...
0
votes
1answer
131 views

Passing User's aliases to root while doing “sudo su”

Is it possible? I could make an alias to sudo su -;source .bashrc but it seems like source .bashrc is executed in the earlier shell and not in root's sheel (Why?)
0
votes
3answers
600 views

Execute a command with root permissions as normal user

I want to execute a command as if I am my normal user, but I want to have root certain permissions. In particular, I have created a phyiscal VirtualBox drive that I want to use as a normal user. I ...
1
vote
4answers
3k views

“Wrapper” ssh script freezes when executing remote command

I am running OSX Mountain Lion and the remote server is CentOS 6. I have several scripts on my local machine that I want to run on the remote server and to that end, I thought to write one script that ...
2
votes
1answer
238 views

Can only use some commands as sudo

I have had a bit of a problem with some commands lately, not working as intended. I wanted to fiddle with some Markdown and try it as a substitute for some simple HTML pages, so I looked into some ...
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 ...
5
votes
2answers
380 views

Shutdown Ubuntu Command

What is the command or application that allows a user to shutdown the computer from gnome. And how does it have privileges while halt requires superuser?
2
votes
3answers
708 views

sudo to kill output of ps, awk, xargs

I want to kill root owned processes containing foo in the process name sudo sh -c "ps aux | grep [f]oo | awk '{print $2}' | xargs kill -15" this command fail as awk and xargs are ignored. sudo sh ...
0
votes
2answers
69 views

How can I run commands like setfsuid, setfsgid as a normal user?

Normally only the root user has permission to run these commands. Is any way I can run these as a normal user?
-1
votes
1answer
149 views

Can I use sudo for kill not root processes?

Can I use sudo for kill only not root processes ?
1
vote
1answer
214 views

Admin group can sudo, but my user in admin group can't

I'm having trouble giving a user sudo access. I have Ubuntu 12.04 LTS on my new VPS. I made a user named portaljacker, added it to the admin group, and admin group is in the sudoers file as %admin ...
2
votes
4answers
286 views

Accidentally did “chmod 600 -R /” on my macbook pro

I accidentally entered sudo chmod 600 -R / when I meant to enter /Documents/some_file and now everything comes up as permission denied. The root password isn't working. All my applications are shut ...
1
vote
1answer
762 views

I get error when I try sudo apt-get update command on Ubuntu 12.10

This is the following error: W: Failed to fetch http://ppa.launchpad.net/sun-java-community-team/sun-java6/ubuntu/dists/quantal/main/source/Sources 404 Not Found W: Failed to ...
2
votes
1answer
515 views

Set default editor for crontab -e invoked with sudo

I'm using Bash on Debian Squeeze. I just read this topic: change default text editor for crontab to vim I have exported both variables VISUAL and EDITOR to vim for normal user and for root. And this ...
1
vote
3answers
313 views

cannot access crontab with sudo after being added to /etc/sudoers list

My user "craig" is in the /etc/sudoers file on my CentOS 5.6 VM, however when I try to access the crontab using the command below I am presented with an error message: sudo crontab -e -u ...
0
votes
1answer
899 views

Execute a remote command after sudo - su anotheruser in Rundeck

I'm new with Rundeck and completely amazed with it and I'm trying to execute a job and my scenario is detailed below: Rundeck is configured with ssh passwordless authentication for user master ...
0
votes
2answers
320 views

Why does redirecting “sudo echo” stdout to a file not give root ownership?

I'm pretty new to using Linux heavily, and I'm trying to learn more about file ownership and permissions. One thing that I stumbled on just now was exactly what the title says, running: ...
-2
votes
3answers
1k views

Remote ssh command using sudo

I have this command: ssh user1@192.168.242.16 'sudo -u oracle fgrep ...' can someone explain me how this command works ? I just know that someone is connecting to remote computer as user1 and want ...
1
vote
0answers
104 views

I can't get through with my password on sudo, can anyone help me?

I know that the password doesn't show up on the screen that's all good. I just can't seem to get any further as I am typing my user password but this comes up: 2012-12-04 22:38:14.815 ...
3
votes
1answer
4k views

sudo + x11 application does not work correctly

I couldn't get any program requiring x11 (e.g. gedit, nautilus) to work with sudo. Using gksudo would just fail silently, while on terminal I received the following error: sudo nautilus ** ...
0
votes
0answers
56 views

Weird behavior of sudo

I use putty to log in to a remote LINUX machine. (Ubuntu 10) When I log in I have to authenticate myself, that goes on pretty smooth. Whenever I try to use sudo or su though, I experience ...
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 ...
2
votes
4answers
1k views

How do I revert to having sudo ask for a password again?

I accidentally made a mistake and made my sudo commands passwordless on my Mac. How can I get it back to default?
2
votes
0answers
60 views

What is the `/etc/hostname` used/required for?

I found in the /etc/hostname my IP-address, than I deleted it and each time I use sudo - I get a message and a system email sudo: unable to resolve host (none) or if in the /etc/hostname is saved ...
0
votes
1answer
157 views

How can I make sudo never ask for a password with a certain argument, but always ask for a password with another argument?

For example, I want to allow sudo shutdown -c to always be run without entering a password, but sudo shutdown without -c to always require a password (even if I've authenticated to sudo previously).
5
votes
3answers
2k views

Automatically execute bash script under the privileges of another user

Is there a way to execute a bash script under the privileges of another user (automatically)? I think "sudo" is the right way, but I don't know how to automate the process. E.g. I want to run ...
1
vote
2answers
681 views

Does sudo really make you root for a little while?

On Linux, in what kind of situations, if any, running a command as a non-root to access a file/folder or create/delete a file/folder using sudo may result in "permission denied" while running the same ...
5
votes
3answers
3k views

Changing ownership without the sudo command

I was setting up a Ubuntu Server and I wanted to allow the FTP client to access the /etc/ folder. So I used the chown command to allow my account to use it. However, this changed the ownership of sudo ...
11
votes
2answers
2k views

Keeping the fancy sudo warning forever

The first time I do sudo on openSUSE I'm always warned with a someway fancy message We trust you have received the usual lecture from the local System Administrator. It usually boils down to these ...
1
vote
2answers
169 views

how to invoke a shell function with sudo permission

There is a shell function add_book in my .zshrc. I need to invoke this function with sudo permission. But when I invoke sudo add_book I get the following error: sudo: add_book: command not found ...