Questions tagged [sudo]

The sudo command is a program for Unix and Unix-like computer operating systems that allows a user to run programs with the security privileges of another user (normally the superuser, or root). The name is an abbreviation for "substitute user do" (as in, do a command as if started by another user).

The sudo command is a program for Unix and Unix-like computer operating systems that allows a user to run programs with the security privileges of another user (normally the superuser, or root). The name is an abbreviation for "substitute user do" (as in, do a command as if started by another user).

Unlike the su command, users typically supply their own password to sudo rather than the root password. After authentication, and if the /etc/sudoers configuration file permits the user access, then the system will invoke the requested command.

2818 questions
1
vote
0 answers

executing script as sudo -u user with php, while stopping apache script get killed also

In my php script I use line like that to execute some script: exec('sudo -u USERNAME ./script.sh', $result) The script is executed correctly by user USERNAME but if I stop apache or it get crashed the script also get killed. How to execute that…
Filip Frątczak
  • 137
  • 1
  • 3
  • 14
1
vote
1 answer

python pexpect & pxssh with sudo and EOF

I make ssh login with this script: import pxssh import pexpect s = pxssh.pxssh() hostname = 'localhost' username = 'py_worker' password = 'nicejob' s.login (hostname, username, password) print "logged in" Then I want to run some program which in…
baltasvejas
  • 1,698
  • 2
  • 17
  • 18
1
vote
0 answers

Dired+Tramp: how to open a directory as root on remote machine?

Let's say I have a user on a remote machine called wvxvw with a password password. The remote machine runs inside a VirtualBox, it is set to forward ports 22 to 3022. This is my ~/.ssh/config on the host: Host ubuntu-server HostName 127.0.0.1 …
user797257
1
vote
1 answer

Execute shell commands with sudo via PHP

So far my search has shown the potential security holes that will be made while trying to perform a sudo'd command from within PHP. My current problem is that I need to run a bash script as sudo on my work web server via PHP's exec() function. We…
William Stewart
  • 841
  • 1
  • 14
  • 27
1
vote
1 answer

Launch a program using sudo

I want to launch a program using sudo, I have used this command sudo './ConnectionManager' On a: Distributor ID: ScientificSL Description: Scientific Linux SL release 5.5 (Boron) Release: 5.5 Codename: Boron (Like Centos5.5) and it…
famedoro
  • 1,223
  • 2
  • 17
  • 41
1
vote
1 answer

Forever stop server.js returns "server.js is not a valid index for a forever process."

I inherited a server and I'm having an odd issue. I was having a problem when running forever start server.js in which it didn't return a message, and then forever list didn't show any forever processes running. After some digging I found that some…
Mrweiner
  • 481
  • 1
  • 8
  • 23
1
vote
1 answer

php sudo shell_exec command runs from command line, but not from browser

I am running lighttpd with php-fpm. I have added the http user to my sudoers, as a nopasswd sudoer. I have the following script: /etc/openvpn/auth.txt'"); ?> It runs fine when I do: sudo -u…
Greg Schoppe
  • 576
  • 1
  • 7
  • 22
1
vote
1 answer

how to terminate some process which is run with sudo with kill

with an unprivileged user account, using bash, I could do: sudo /bin/sleep 6000 and kill it with Ctrl-c. However, sending SIGINT or SIGKILL from another terminal won't work for that purpose. Anyone knows why is that? I'd like to be able to kill the…
user2553863
  • 682
  • 1
  • 8
  • 17
1
vote
2 answers

Executing PHP shell command requires sudo access

I have written PHP code to execute shell command This is not working at all from browser. But what I analysed is, it running same command requires "sudo" permission. I am not sure how could I allow my PHP file to execute…
Parag Diwan
  • 3,007
  • 2
  • 19
  • 37
1
vote
1 answer

Can't access shared objects when using sudo

I've installed a program, Player, and am now trying to run the player command. The player requires a .cfg file as input, e.g player create.cfg I notice that I am able to run the above command fine as a normal user, but when I run it as root, sudo…
maditya
  • 8,626
  • 2
  • 28
  • 28
1
vote
2 answers

Raspberry PI: PHP call python script with sudo

i'm running Nginx on my Raspberry PI with PHP 5.4.14 (fpm-fcgi). It all works well. But in one script i make a shell call using shell_exec. echo shell_exec("sudo python " . $file); it works well if i use the console with php test.php but if i…
Le_Morri
  • 1,619
  • 14
  • 18
1
vote
1 answer

Ruby on Rails: Why do I have to use sudo for commands to succede?

I'm learning ruby on rails... I've was able to install an app on my OSX (10.8.3) localhost but it was very problematic most commands failed with permission-related errors unless I used sudo: $ refinerycms ./ $ bundle install $ bundle update $ rails…
emersonthis
  • 32,822
  • 59
  • 210
  • 375
1
vote
1 answer

WinSCP/CuteFTP - Download files owned by another user

I have a "sudo user" account created on my server. When using PuTTY, sudo "operation" allows me to do any operation without any problems; However I have a 37M file I need to check and I need to download it to my local machine; the problem is that…
Ihab
  • 170
  • 1
  • 6
1
vote
2 answers

how can I run a perl script which needs root?

I need to execute a perl script located in /root/scripts/ from php using ssh from another computer or from the same computer. The thing is that I just don't know how to make php log into roots account to excecute only that file. As user$ I can't…
Jose Andradez
  • 37
  • 2
  • 9
1
vote
1 answer

How to run Zend Studio Remote Systems SSH using sudo bash

In regular SSH, I can login as a user "foobar" with a password "pwd" and type sudo bash and the same password "pwd" to perform superuser activities. I setup a Zend Studio WorkSpace for the same SSH server using Remote Systems SSH access and login as…
user1207994
  • 30
  • 1
  • 7