title: Ssh to remote server through windows batch
body: <p>Can anyone suggest me how I can use Windows Batch Program to <code>ssh</code> to remote server and then execute <code>shell scripts</code> over there?</p>
  
  <p>Any simple sample example will be good for me to start on this.</p>
  
  <p>Server Name:- <code>ares-ingest.vip.host.com</code></p>
  
  <p>Username:-   <code>uname</code></p>
  
  <p>Password:-   <code>password</code></p>
  
  <p>Any suggestions will be appreciated as I am new to Windows Batch Program</p>
  
  <p><strong>Update:-</strong></p>
  
  <p>I tried using <code>plink</code> to execute the shell script that I have on my local machine and I always get the error like below, Is there anything wrong I am doing?</p>
  
  <pre><code>C:\PLINK&gt;plink uname@cli.host.com -m email.sh
  Using keyboard-interactive authentication.
  Password:
  Using keyboard-interactive authentication.
  Your Kerberos password will expire in 73 days.
  
  sh: HIVE_OPTS= -hiveconf mapred.job.queue.name=hdmi-technology: is not an identifier
  </code></pre>
  
  <p>Below is the content in my shell script-</p>
  
  <pre><code>#!/bin/bash
  export HIVE_OPTS="$HIVE_OPTS -hiveconf mapred.job.queue.name=hdmi-technology"
  hive -S -e 'SELECT count(*) from testingtable2' &gt; attachment.txt
  </code></pre>