I need to connect to linux,run script which requires sudo.
now i am trying this way:
plink.exe -ssh -pw mypassword -noagent firstname.lastname@example.org "sudo /var/squid/myscript.sh
in linux i added in /etc/sudoers file:
myname ALL=(ALL) NOPASSWD: /var/squid/myscript.sh
chown u+x /var/squid/myscript.sh
the script inside:
#!/bin/bash touch testfile.txt
When i run the script from linux console:
it works with no password, but when i try to do it from remote windows using plink.exe it does not work. Any ideas ?