Chinaunix首页 | 论坛 | 博客
  • 博客访问: 44599
  • 博文数量: 4
  • 博客积分: 186
  • 博客等级: 入伍新兵
  • 技术积分: 50
  • 用 户 组: 普通用户
  • 注册时间: 2007-08-19 14:49
文章分类

全部博文(4)

文章存档

2014年(2)

2010年(2)

我的朋友

分类:

2014-08-21 10:47:04

原文地址:putty psftp 的用法 作者:finger_lake

先说一说putty 使用RSA 公钥密码机制登陆吧,这个网上介绍比较少。尤其对于psftp的介绍,putty的官方网站仅仅是提了一下
首先打开windows 下的dos 窗口
进入 pstfp 所在路径 或者 set PATH=C:\path\to\putty\directory;%PATH%

第一步是建立连接:
psftp -i private_key.ppk
putty 会提示输入用户名和端口
输入
open finger_lake@150.45.21.70

这时已经建立了连接。
第二部 上传文件

put file
默认传到 home 目录下

get /home/fingelake/file
从remote server 上下载文件

下面是对putty常用选项的一些描述。

To add the directory containing PSFTP to your PATH environment variable, type into the console window:

set PATH=C:\path\to\putty\directory;%PATH%
psftp fred@server.example.com

6.1.1 -l: specify a user name

The -l option is an alternative way to specify the user name to log in as, on the command line. Instead of typing psftp user@host, you can also type psftp host -l user.

6.1.2 -P: specify a port number

If the host you specify is a saved session, PSFTP uses any port number specified in that saved session. If not, PSFTP uses the default SSH port, 22. The -P option allows you specify the port number to connect to for PSFTP's SSH connection.


Section 6.2: Running PSFTP

To create a connection, type open host.name, or if you need to specify a user name as well you can type open user@host.name.

6.2.7 The get command: fetch a file from the server

To download a file from the server and store it on your local PC, you use the get command.

In its simplest form, you just use this with a file name:

get myfile.dat

If you want to store the file locally under a different name, specify the local file name after the remote one:

get myfile.dat newname.dat

This will fetch the file on the server called myfile.dat, but will save it to your local machine under the name newname.dat.

6.2.8 The put command: send a file to the server

To upload a file to the server from your local PC, you use the put command.

In its simplest form, you just use this with a file name:

put myfile.dat

If you want to store the file remotely under a different name, specify the remote file name after the local one:

put myfile.dat newname.dat

This will send the local file called myfile.dat, but will store it on the server under the name newname.dat.

6.2.9 The reget and reput commands: resuming file transfers

If a file transfer fails half way through, and you end up with half the file stored on your disk, you can resume the file transfer using the reget and reput commands. These work exactly like the get and put commands, but they check for the presence of the half-written destination file and start transferring from where the last attempt left off.

The syntax of reget and reput is exactly the same as the syntax of get and put:

reget myfile.dat
reget myfile.dat newname.dat







阅读(1171) | 评论(0) | 转发(0) |
0

上一篇:Nagios Server安装配置

下一篇:没有了

给主人留下些什么吧!~~