title: SSH to remote Windows machine using username and password through shell script
body: <p>I am trying to SSH to a remote Windows machine (an AWS ec2 instance) by using an username and password of the remote machine. I need to automate this connection to run some remote commands from my script (either shell or Power shell) without prompting me for a password, My script shouldn't fail by expecting a password to be prompted</p>
  
  <p>I don't want to use sshpass or any generated keys (by using ssh-keygen). Since the source machine where I run this command/script is not a dedicated machine, I may run it on a different machine everytime. I also gave a try to connect using the .PEM file provided by AWS as below (thought it could be easy while using it the script).</p>
  
  <pre><code>$ssh -i aws_keypair.pem Administrator@10.10.10.10
  Administrator@10.10.10.10's password:
  </code></pre>
  
  <p>It is still expecting me for a password even if I used the .PEM file, I also tried to created an file 'authorized_keys' in the remote Windows machine under the path "C:\Users\Administrator.ssh\". Still it is prompting me for a password.</p>
  
  <p>Expectation :</p>
  
  <p>Connect to remote Windows machine using PEM file and run some remote commands.</p>
  
  <p>(or)</p>
  
  <p>It shouldn't prompt me for a password while I try for the connection from some script (shell/power shell).</p>