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
19
votes
2 answers

What causes transport: "dial unix /var/run/docker/containerd/docker-containerd.sock: connect: connection refused"?

There are good explanations on how to resolve this issue. SOF Q1, SOF Q2 and many more related questions on SOF and internet. My worry is, what causes this issue and why docker ends up in this state. (/var/run contains run time data of an…
user8339674
19
votes
7 answers

Running Pycharm as root from launcher

How is it possible to run Pycharm from the launcher with root privileges? I can do that from the terminal window, with sudo ./pycharm.sh, but I'd like to do the same directly from the launcher.
Zorgmorduk
  • 1,265
  • 2
  • 16
  • 32
19
votes
1 answer

sudo mkdir in /usr/, Operation not permitted. El Capitan

Attempting to install PHP, which requires the creation of an extensions directory within /usr/lib/php/extensions. The installation returned an error "Operation not permitted". I have since found out, sudo is not able to create any directories under…
THEK
  • 740
  • 2
  • 10
  • 29
19
votes
2 answers

Why using curl | sudo sh is not advised?

While I was reading the introduction to the Rust programming language, I came across the installation method which asks to use the following command curl -sf -L https://static.rust-lang.org/rustup.sh | sudo sh with a note of caution that this is…
avinash pandey
  • 1,321
  • 2
  • 11
  • 15
19
votes
2 answers

Getting message "sudo: must be setuid root", but sudo IS already owned by root

I'm trying to run sudo, and it's failing: gregd@david $ sudo ls sudo: must be setuid root gregd@david $ which sudo /usr/bin/sudo gregd@david $ ll /usr/bin/sudo -rwxr-xr-x 1 root root 165K 2012-05-16 00:25 /usr/bin/sudo* Any suggestions on how to…
Greg Dougherty
  • 3,281
  • 8
  • 35
  • 58
19
votes
3 answers

Setting up process.env variables using EXPORT while running node with sudo

I'm using node.js on EC2 I type EXPORT PORT=80 in terminal, and i see that it correctly saves it when i type EXPORT But when I run my node.js app with the following: ... console.log(process.env); ... PORT is not listed in the object when I'm…
gotta have my pops
  • 878
  • 4
  • 11
  • 22
19
votes
2 answers

How do I sudo if in Bash?

I need to check for a directory in the home directory of another user. Normally I would sudo but that forks another process and I also lose my environment. For example, I have: if [[ -d "/home/otheruser/svn" ]]; then echo "SVN exists" else …
Dan S
  • 9,139
  • 3
  • 37
  • 48
18
votes
1 answer

Fabric - sudo -u

I'm using fabric to launch a command on a remote server. I'd like to launch this command as a different user (neither the one connected nor root). def colstat(): run('python manage.py collectstatic --noinput') Trying def colstat(): sudo('-u…
Pierre de LESPINAY
  • 44,700
  • 57
  • 210
  • 307
18
votes
6 answers

Run a linux system command as a superuser, using a python script

I have got postfix installed on my machine and I am updating virtual_alias on the fly programmatically(using python)(on some action). Once I update the entry in the /etc/postfix/virtual_alias, I am running the command:sudo /usr/sbin/postmap…
Nanda Kishore
  • 2,789
  • 5
  • 38
  • 61
18
votes
3 answers

Running Python script as root (with sudo) - what is the username of the effective user?

I've recently began using ConfigParser() for my python scripts to add some functionality to them for config files. I know how to use it but I have a problem. My script needs to run as the root user, using sudo. The config files are in…
Jmariz
  • 235
  • 1
  • 3
  • 8
18
votes
3 answers

wget command not found on linux server

I have a linux server (completely new, web hosting, nothing is installed into it), and want to use a "wget" command. Currently, it is not found. Kernel version 2.6.32-896.16.1.lve1.4.54.el6.x86_64 I am completely new to linux, tried to solve this…
user97
  • 227
  • 1
  • 2
  • 6
18
votes
3 answers

Capistrano is hanging when prompting for SUDO password to an Ubuntu box

I have a capistrano deployment recipe I've been using for some time to deploy my web app and then restart apache/nginx using the sudo command. Recently cap deploy is hanging when I try to execute these sudo commands. I see the output: "[sudo]…
MikeN
  • 45,039
  • 49
  • 151
  • 227
18
votes
3 answers

Checking sudo in Bash (script with if statements)

I've been working with bash for not more than 6 hours, and now I'm trying to create a menu that allows you to do some "fun" stuff :D. My problem is with the if statement that check if you're in sudo mode. I want to have 3 conditions: If I execute…
Patryk
  • 183
  • 1
  • 1
  • 5
17
votes
7 answers

How to use sudo inside of a Run Script build phase in Xcode 4?

I need use execute a command inside of a script in a Run Script build phase in Xcode 4 using sudo. However, the compiler complains: sudo: no tty present and no askpass program specified Anyone have a clever solution for this problem?
ericg
  • 8,413
  • 9
  • 43
  • 77
17
votes
1 answer

How can I take persistent permissions in electron app?

I am creating an electron app where I need to scan and update files which need root permission. I know I can run such commands using sudo.exec() in that way: sudo.exec ("rm /private/var/log/fsck_hfs.log", options, (e, stdout, stderr) => {}); And…
Nargis
  • 739
  • 7
  • 30