【问题标题】:Ssh to remote server through windows batch通过 Windows 批处理 SSH 到远程服务器
【发布时间】:2012-07-27 02:08:27
【问题描述】:

谁能建议我如何使用 Windows 批处理程序将ssh 发送到远程服务器,然后在那里执行shell scripts

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

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

用户名:-uname

密码:-password

由于我是 Windows 批处理程序的新手,任何建议都将不胜感激

更新:-

我尝试使用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

【问题讨论】:

    标签: windows shell batch-file


    【解决方案1】:

    尝试使用plink 发送您的命令。

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

    【讨论】:

    • 我会检查那个链接,但如果你能提供一个满足我要求的例子,那对我来说会很好理解。
    • 我已经更新了我的问题,因为在远程服务器上执行 shell 脚本使用 plink 后,我收到了错误,我不知道它为什么会出现。你能帮帮我吗?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-12-24
    • 2015-06-27
    • 1970-01-01
    • 2023-03-08
    • 2016-12-17
    • 2017-02-15
    • 1970-01-01
    相关资源
    最近更新 更多