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
104
votes
5 answers

Use sudo with password as parameter

I would like to run sudo with my password as parameter so that I can use it for a script. I tried sudo -S mypassword execute_command but without any success. Any suggestions?
ccman
  • 1,283
  • 2
  • 10
  • 10
102
votes
7 answers

Copying a local file from Windows to a remote server using scp

I try to transfer a folder of files from my local computer to a server via ssh and scp. After getting sudo privileges, I'm using the command as follows: scp -r C:/desktop/myfolder/deployments/ user@host:/path/to/whereyouwant/thefile However, I get…
HelloWorld
  • 4,251
  • 8
  • 36
  • 60
93
votes
10 answers

Execute a shell script in current shell with sudo permission

To execute a shell script in current shell, we need to use a period . or a source command. But why does it not work with a sudo permission? I have a script with execute permission called setup.sh. When I use a period, I get this: $ sudo . ./setup.sh…
shar
  • 1,988
  • 2
  • 18
  • 25
90
votes
5 answers

sudo cat << EOF > File doesn't work, sudo su does

I tried the following on the command prompt in bash: sudo cat << EOF > /etc/yum.repos.d/some-name.repo #Content #.... #... EOF It complained : -bash: /etc/yum.repos.d/some-name.repo: Permission denied Then I did sudo su and tried the exact same…
iamauser
  • 11,119
  • 5
  • 34
  • 52
82
votes
8 answers

How to run SUDO command in WinSCP to transfer files from Windows to linux

I am trying to use WinSCP to transfer files over to a Linux Instance from Windows. I'm using private key for my instance to login to Amazon instance using ec2-user. However ec2-user does not have access to write to the Linux instance How do I sudo…
PC2015
  • 977
  • 1
  • 6
  • 10
79
votes
12 answers

AWS error - sudo: unable to resolve host ip-10-0-xx-xx

I launched a new aws instance. My private ip is ip-10-0-xx-xx as per amazon console. Everytime when I do a sudo command, I get the following error sudo: unable to resolve host ip-10-0-xx-xx How can I rectify this error?
Rahul
  • 44,892
  • 25
  • 73
  • 103
79
votes
19 answers

ERROR: While executing gem ... (Gem::FilePermissionError)

I have checked all the other similar answers and none was exactly like mine, neither did any of those solutions work for me. gem environment and sudo gem environment give the same result: RubyGems Environment: - RUBYGEMS VERSION: 1.5.3 - RUBY…
Ava
  • 5,783
  • 27
  • 58
  • 86
78
votes
3 answers

Unable to use sudo commands within Docker, "bash: sudo: command not found" is displayed

I have installed TensorFlow using the following command docker run -it b.gcr.io/tensorflow/tensorflow:latest-devel and I need to set up TensorFlow Serving on a windows machine. I followed the instructions and while running the below-mentioned sudo…
Vasanti
  • 1,207
  • 2
  • 12
  • 24
78
votes
12 answers

How to install Intellij IDEA on Ubuntu?

I'm new to Ubuntu and Linux in general. I want to code in Java on my computer, but I'm having problems installing IntelliJ IDEA on Ubuntu. I have downloaded and extracted the file and for some reason renamed the folder to idea. I tried moving the…
Emil Øgård
  • 1,009
  • 2
  • 10
  • 12
74
votes
6 answers

npm / yeoman install generator-angular without sudo

I tried to install generator-angularjs using Yo (Yoeman) without sudo: npm install -g generator-angular I get: Error: EACCES, mkdir '/usr/lib/node_modules/generator-angular' When I type in sudo yo, yo tells me that I should not use sudo (which is…
Karan
  • 14,824
  • 24
  • 91
  • 157
73
votes
4 answers

How to install RVM system requirements without giving sudo access for RVM user

On my Debian server I have a user called "deployer" that does not have sudo access, and has RVM installed. When installing Ruby using "deployer", like 1.9.3, it triggers a task to install dependencies "Installing requirements for debian, might…
Vitaliy Yanchuk
  • 1,463
  • 1
  • 11
  • 22
70
votes
5 answers

How to install a module for all users with pip on linux?

How to install a package in the standard python environment i.e. /usr/local/lib/python2.7/dist-packages using pip and make this new package available for all the users without using virtualenv? By using the following, the package is installed with…
nowox
  • 25,978
  • 39
  • 143
  • 293
65
votes
1 answer

What does sudo -H do?

After trying to install virtualenv with pip $ pip install virtualenv I got a permission denied error IOError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/virtualenv.py' So I used sudo to install virtualenv $ sudo pip install…
Peter Tao
  • 1,668
  • 6
  • 18
  • 29
60
votes
1 answer

user vs sudo vs sudo_user in ansible playbooks

I have read the Ansible documentation but I am still a bit confused about the three following parameters in ansible playbooks: user, sudo, sudo_user. I have tried the following playbooks with different combination of the parameters: user:deploy =>…
Michael
  • 8,357
  • 20
  • 58
  • 86
59
votes
3 answers

How to give a Linux user sudo access?

I am trying to give sudo access to one of my users. What should I type in my terminal?
Adam Boostani
  • 5,999
  • 9
  • 38
  • 44