0

hi I have a shell script that I need to excute remotely from a windows machine in a freebsd vm

im using plink to do it but unfortunately it's not working

i followed the documentation and here is my command :

echo y | C:path\plink.exe  -ssh $user@$ComputerName -pw $pwd -t "echo $npwd | sudo -S  sh script.sh " 

$npwd is the password with double qoutes as in freebsd it needs to be double qouted

like :

echo "password" | sudo -S command 

note : i need to add the password because i can't edit the sudoers file (not an option in my case)

is there a way to fix this issue ?

i hope someone can guide me to the right direction.

0 Answers0