Chinaunix首页 | 论坛 | 博客
  • 博客访问: 400107
  • 博文数量: 103
  • 博客积分: 3073
  • 博客等级: 中校
  • 技术积分: 1078
  • 用 户 组: 普通用户
  • 注册时间: 2010-03-23 15:04
文章分类

全部博文(103)

文章存档

2012年(13)

2011年(76)

2010年(14)

分类:

2010-11-29 21:37:02

先说一说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







阅读(19227) | 评论(1) | 转发(1) |
0

上一篇:intel assembly and AT&T

下一篇:pftp 的用法

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

chinaunix网友2010-11-30 11:14:53

很好的, 收藏了 推荐一个博客,提供很多免费软件编程电子书下载: http://free-ebooks.appspot.com