Hello Experts,
I am creating a run time powershell script on Linux machine and copying that powershell script to Windows machine. To connect to windows through "ssh", I am using Cygwin tool. To make the connection password less I copied my public in authorized_keys in windows Administrator account and now I am able to login without password like below and able to run some powershell script like echoing "Hello world" and running some Windows command from Linux machine
.
HTML Code:
ssh Administrator@windowsServer
But, when I call any script that needs elavated access(tha's what I observed, I may be wrong also" it gives me error.
odshekhar@LinuxMachine:/tmp$ ssh odshekhar@Windowsmachine 'powershell -executionpolicy bypass -File "C:\scripts\abc.ps1"'
If I delete my public key from windows machine and perform the same operation from Linux machine(that is if i don't use password less connection), It asks me my password for Windows machine and it works.
So, in short, it does not work when I try to use passowrd less connection and works if I dont use passowrd less connection.
Please note it is not a permission issue or any issue to establish a connection to make a connection because I am able to run simple script making password-less connection and able to run many commands too.
Thanks in advance!