通过Windows批处理Ssh到远程服务器

时间:2012-07-27 02:08:28

标签: windows shell batch-file

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

任何简单的示例都将对我有所帮助。

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

用户名: - uname

密码: - password

任何建议都将受到赞赏,因为我是Windows Batch Program的新手

更新: -

我尝试使用plink来执行我在本地计算机上运行的shell脚本,并且总是得到如下错误,我有什么问题吗?

C:\PLINK>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

以下是我的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 个答案:

答案 0 :(得分:1)

尝试使用plink发送命令。

Usage: plink [options] [user@]host [command]