问题描述
我有一种情况,我需要运行的在的从Windows Linux shell命令频繁(具有不同的文件名)。我使用的腻子和WinSCP赋予做到这一点(需要登录名和密码)。此文件通过WinSCP赋予复制到predefined文件夹中的Linux机器,然后将命令从腻子运行。有没有通过,我可以通过程序自动执行此办法。理想情况下,我想用文件名作为参数右击从Windows文件并发出这将文件复制到远程机器上的命令,并运行predefined命令(腻子)。
I have a scenario where I need to run a linux shell command frequently (with different filenames) from windows. I am using PuTTY and WinSCP to do that (requires login name and password). The file is copied to a predefined folder in the linux machine through WinSCP and then the command is run from PuTTY. Is there a way by which I can automate this through a program. Ideally I would like to right click the file from windows and issue the command which would copy the file to remote machine and run the predefined command (in PuTTy) with the filename as argument.
推荐答案
有可能会与自动登录常用方法的安全性问题。
其中最简单的方法如下记载:
There could be security issues with common methods for auto-login.One of the most easiest ways is documented below:
- Running Putty from the Windows Command Line
和作为一部分执行命令
在腻子UI,连接> SSH>有远程命令字段。
And as for the part the executes the commandIn putty UI, Connection>SSH> there's a field for remote command.
4.17 SSH面板
在SSH面板允许您配置
仅适用于SSH选项
会话。
The SSH panel allows you to configure options that only apply to SSH sessions.
4.17.1在服务器上执行特定命令
4.17.1 Executing a specific command on the server
在SSH,你没有运行
在服务器上一般的shell会话。
相反,你可以选择运行
单个特定命令(如
邮件用户代理,例如)。如果你
要做到这一点,在输入命令
远程命令对话框。
http://the.earth.li/~sgtatham/putty/0.53/htmldoc/Chapter4.html
总之,你的答案或许也同样是类似下面的文字:
in short, your answers might just as well be similar to the text below:
- let Putty run command in remote server
这篇关于自动化Linux上从Windows PuTTY的使用正在运行的命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!