-1
votes
1answer
51 views

alternatives to insecure sudo?

How do I protect my environment from sudo erasing half of it? It seems I can protect variables, but functions that the variables (like the prompt, for example) rely on are undefined. This means that ...
0
votes
0answers
17 views

path setting appears twice in env output

After an OS version upgrade I have the following strange problem: % port MacPorts 2.3.1 ... % sudo -i # port MacPorts 2.3.1 % sudo port sudo: port: command not found Furthermore, if I do it all ...
0
votes
0answers
29 views

Broken sudo commands

How to repair sudo to use standard commands? I cannot use any command with sudo.
2
votes
2answers
129 views

Issue with environment variable

Please help me running below command from user2 account. I cannot figure out what's the issue with this. [user2@localhost bin]# sudo -u user1 /opt/Tomcat/bin/shutdown.sh Neither the JAVA_HOME nor the ...
0
votes
1answer
222 views

How to a sudo command which keeps all environment variables

Example command is as follows, run as a normal user which python /home/me/env/development/python because the PATH environment contains a path that points out to this instance of python (instead to ...
0
votes
1answer
41 views

Why does 'which' give incorrect result?

I am executing on a Ubuntu 12.04 shell the following command: sudo bash -c "echo $PATH; which python" which displays something like ...
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 ...
2
votes
2answers
2k views

sudo, runuser, su don't work as I expect when run as root with command as “echo $HOME”

When I run these commands it outputs as shown. /root $ sudo -u someuser -i "echo $HOME" /root $ runuser -l someuser -c "echo $HOME" /root $ su - someuser -c "echo $HOME" /root What i expected ...
25
votes
3answers
44k 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 ...
1
vote
1answer
1k views

Set environment variable for another user (Standalone Trac problem)

I'd like to run tracd (Trac in standalone mode) with custom template for multiple repository list: $ tracd -p 8080 -e /my/projects/path For custom template, I need an environment variable (as said ...
0
votes
2answers
876 views

Make environment variables available when running command as sudo

I am using Curl, and am having a problem trying to get it to recognize the $http_proxy environment variable when using sudo curl. I tried putting export http_proxy=.... in my /etc/profile and ...