Skip to main content

Questions tagged [sudo]

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.

211 votes
12 answers
622k 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 ...
Jichao's user avatar
  • 7,580
13 votes
3 answers
62k views

How to change user in WinSCP?

I'm using WinSCP to access Unix computers. How can I change user after I have logged into a Unix server using WinSCP? E.g. I have personal account in Unix computer A. I can log into this computer ...
jrara's user avatar
  • 419
54 votes
6 answers
121k views

How do I make sudo preserve my environment variables?

Using sudo 1.7.4p4 on Solaris 5.10 and sudo 1.6.7p5 on RHEL4 u6 I can't see how to preserve my environment variables, for instance $PYTHONPATH. I've added this line to sudoers, but it doesn't make any ...
aknuds1's user avatar
  • 9,428
1 vote
1 answer
3k views

how do I run a sudo command and load the environment variables of current logged on user?

I need to run an ssh sudo command. command is as follows: ssh -i keyfile [email protected] 'sh -v /opt/dir/script' the script contains the following: sudo -E node some.js the reason I use the -E ...
reza's user avatar
  • 375
336 votes
9 answers
116k views

How to append to a file as sudo?

I want to do: echo "something" >> /etc/config_file But, since only the root user has write permission to this file, I can't do that. But the following also doesn't work. sudo echo "something" ...
agentofuser's user avatar
  • 7,437
82 votes
4 answers
105k views

How to set path for sudo commands

If I issue sudo my-command how does Linux look for that my-command? The my-command is in my PATH. I can invoke it without any problem. However, when I invoke it with sudo, I'll get command not found. ...
xpt's user avatar
  • 8,851
60 votes
6 answers
118k views

command not found when using sudo

There are a few question on the site that seem related to my problem but I could not find a solution in any of them. My operating system is Ubuntu 12.04. I have mvn installed in /tools/noarch/apache-...
Ivaylo Strandjev's user avatar
32 votes
5 answers
63k views

How to prevent sudo users from running specific commands?

I have a very sensitive network setup and I really dont want to mess up with it. My network consists a bunch of users who are with sudo privilege. I want to stop them from running service ...
shekhar's user avatar
  • 774
5 votes
3 answers
35k views

How to provide password directly to the sudo su -<someuser> in shell scripting

I got a requirement to automate in shell script for sudo su -<someuser> which asks for password. How to provide password directly to the sudo su - in shell scripting for IBM AIX servers. I have ...
raamsaara's user avatar
138 votes
7 answers
293k 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 ...
Neil's user avatar
  • 1,505
53 votes
5 answers
45k 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 ...
Ranger's user avatar
  • 703
18 votes
0 answers
7k views

sudo unable to write to /etc/profile [duplicate]

I am following the instructions on this site for Grails installation, but am not able to write to /etc/profile like it instructs. sudo echo ‘JAVA_HOME=/usr/lib/jvm/java-6-sun’ >> /etc/profile ...
Matt Norris's user avatar
18 votes
4 answers
35k views

How I can make sudo session an hour and not few minutes in Ubuntu 10.04?

How I can make sudo Ubuntu 10.04 session an hour and not few minutes? Now I have to write my password for sudo commands every few minutes.
Ben's user avatar
  • 1,377
8 votes
5 answers
7k views

Should I use sudo in a script or sudo an entire script?

I run a small group of macOS machines for students (say 20) and they all need to be setup with things like homebrew and other packages and applications. I'm writing a bash script to automatically ...
James C.'s user avatar
7 votes
2 answers
14k views

Sudoers NOPASSWD for single executable but allowing others

Operating System: Arch Linux Linux version: 4.16.11 Sudo version: 1.8.23 What I need: be able to execute any executable with a sudo with a password prompt be able to execute one executable, /home/...
Yaroslav Mytkalyk's user avatar

15 30 50 per page
1
2 3 4 5
8