Skip to content

Tag: sudo

Sudoers.d file is not picking up in SLES SP5

I was working with some Linux service file and in one scenario I need to invoke systemctl command as a different user say sar user. So I have wrote one sudoers file(/etc/sudoers.d) and added the following code and I am invoking the command using sudo prefix its working for the most of the Linux version but in…

Django – can’t run server as sudo

I’m creating a soft AP in order to configure my raspberry wireless from it. I alread have an script to create a hotspot, a dhcp server and now i need to run a django app using sudo. (Yes, using sudo. I’m waking up my django server from my python script, and the script needs to run as sudo) I&#8217…

Cannot execute command as another user with sudo

I have this code, that is running on tomcat: And my script.sh file: From command line, the script is executed excellent and I see results. But when executing it from tomcat I get this message: I cannot solve this problem. I need your help. P.S: Sorry me for bad english. Thanks! Answer I guess that the problem…

issue in logging in as sudo user

here is the script sample.expect : expecting to log into the host as sudo user. but getting issue [sudo] password for USER: invalid command name “sudo” while executing “sudo” invoked from within “expect “[sudo] password for USER:”” (file “sample.expect&#82…

Why can’t I sudo echo a line in /etc/?

I am on centos and I did sudo echo ‘testline’>>/etc/test/test it said -bash: /etc/test/test: Permission denied However, when I do sudo vi /etc/test/test and insert testline and do :wq it writes out fine, why is this happening? Answer You need to wrap the whole statement (including the redire…

preserve inline variable with sudo

Hi i’m trying to make something like this to work in bash but i keep getting an empty line, the only thing that works so far is: what i would like to achieve is the ability to inline a variable for the sudo command i also tried this as suggested here but with no luck, am i missing something? Answer