I researched this question and all answers suggest visudo to add: Defaults:user !requiretty It does not work! I have two Linux boxes (RedHat). I have a Java class which uses ProcessBuilder/Process to execute commands. The class runs under a system account. On both boxes, I run and provide the password for other-user in an input stream to the Process object.
Tag: su
Can I use ssh to login another host and automatically “su” to another user? [closed]
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question
permission denied when using su to execute a node program
here is my node program it is in /home/test/ and the test directory ‘s privilege is rwxrwxrwx. when i run node test.js with the tomcat account, the data.txt could be created. but when i run a service to execute su tomcat -c ‘node /home/test/test.js’, the data.txt could not be created and there is a permission denied hint in the stdout.
How do you find the original user through multiple sudo and su commands?
When running a script via sudo or su I want to get the original user. This should happen regardless of multiple sudo or su runs inside of each other and specifically sudo su -. Answer Results: Use who am i | awk ‘{print $1}’ OR logname as no other methods are guaranteed. Logged in as self: Normal sudo: sudo su