Putty command line for Windows
来源:互联网 发布:淘宝返利机器人免费 编辑:程序博客网 时间:2024/05/04 22:05
要写一个脚本,将指定的文件 上传到 云服务器上去(就是一个 Linux 主机)。工作环境是 windows 。如果是工作环境是 Linux ,那么这没什么,用 ssh 可以很容易的实现。但问题就处在 windows 上。众所周知,windows 上的 ssh 就是 putty 了,这里面又一个工具叫 pscp, 相当于是 Linux 的 scp 命令,这个 pscp 程序调用相对简单,这里暂时不讨论。主要是这个,我想将 tar 文件上传到 Linux 主机之后,再 执行目标主机上的脚本,将这个 tar 文件解压到指定目录。这就相当于是 ssh 执行远端命令。我试着在 cmd 中打开 putty,但是“怎么也找不到相关的命令行参数”, google 了好久也没找到想要的信息。最后在高人指点下,在 putty commandline 中找到了相关信息,当然还参考了stackoverflow 上的一些信息。总之,将所有信息聚合起来,就是我得到的下面的这个命令。
pytty -ssh root@your.server.example -pw yourpasswd -m command
上面命令,比较重要的是 -ssh -m 参数。-m 参数是指定一个文件这个文件中里的内容会被当作服务器命令在 目标服务器 一行一行的执行,-ssh 是putty 选择的协议,-ssh 是选择ssh 协议。有了上面的基础,那么实现我的功能也没什么问题了,就是在 command 文件中写上 服务器端的 解压命令 就行。 当然, command 文件要让 putty 能找的到,路径自己配置吧。
0 0
- Putty command line for Windows
- putty command line
- Putty Command-Line Parameter
- [git] Basic Git Command Line Reference for Windows Users
- Windows Xp: Command Line
- Windows Administration at the Command Line for Windows Vista, Windows 2003, Windows XP, and Windows
- Command Line Shell For SQLite
- Command Line Shell For SQLite
- Windows常用command line操作
- PuTTY + Xming, using gedit command under windows.
- Windows Administration at the Command Line for Windows 2003, Windows XP, and Windows 2000: In the Fi
- windows 8 安装 oracle 11g 报错:command line option syntax error,type command/? for help
- Basic for MEL, command line modes
- Python - Parser for command line options - optparse
- Python - Parser for command line options - argparse
- python转义字符串for shell command line
- 一个在线的command line for linux
- Command line tools for Machine learning
- ImageView的background和src属性有什么区别
- ZooKeeper--一个具有高可用性的高性能协调服务
- wamp环境下安装Zend Framework2.3
- 蛋蛋随笔2
- 互联网协议入门(上)
- Putty command line for Windows
- ZOJ-3326
- Perl发邮件 Nnt::SMTP::SSL
- Java中foreach用法,增强型的for循环的样例和解释
- 今天周末
- 死亡是一瞬间的事吗
- quick-cocos2d-x 多分辨率适配详解
- Spring配置datasource的三种方式
- Java 继承与多态实验