2012-07-27 65 views
1

任何人都可以建议我如何使用Windows批处理程序到ssh到远程服务器,然后在那里执行shell scripts通过Windows批处理SSH到远程服务器

任何简单的示例示例对我来说都是很好的开始。

服务器名称: - ares-ingest.vip.host.com

用户名: - uname

密码: - password

任何建议将作为我的新的Windows批处理程序

更新理解: -

我tr使用plink来执行我在本地机器上的shell脚本,并且我总是得到如下的错误,我有什么错误吗?

C:\PLINK>plink [email protected] -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 

下面是我的shell内容脚本 -

#!/bin/bash 
export HIVE_OPTS="$HIVE_OPTS -hiveconf mapred.job.queue.name=hdmi-technology" 
hive -S -e 'SELECT count(*) from testingtable2' > attachment.txt 

回答

1

尝试使用plink超过发送你的命令。

Usage: plink [options] [[email protected]]host [command] 
+0

我会检查链接,但如果你能为我提供一个满足我的要求的例子,那对我来说是非常好的理解。 – AKIWEB 2012-07-27 02:19:16

+0

我已经更新了我的问题,因为在远程服务器上执行shell脚本使用plink后,出现错误,我不知道为什么它会到来。你能帮我一下吗? – AKIWEB 2012-07-27 02:55:33

相关问题