Xshell5利用sftp在远程服务器传输文件课案.docx
文本预览下载声明
sftp是Secure File Transfer Protocol的缩写,安全文件传送协议。可以为传输文件提供一种安全的加密方法。sftp 与 ftp 有着几乎一样的语法和功能。SFTP 为 SSH的一部分,是一种传输档案至 Blogger 伺服器的安全方式。其实在SSH软件包中,已经包含了一个叫作SFTP(Secure File Transfer Protocol)的安全文件传输子系统,SFTP本身没有单独的守护进程,它必须使用sshd守护进程(端口号默认是22)来完成相应的连接操作,所以从某种意义上来说,SFTP并不像一个服务器程序,而更像是一个客户端程序。SFTP同样是使用加密传输认证信息和传输的数据,所以,使用SFTP是非常安全的。但是,由于这种传输方式使用了加密/解密技术,所以传输效率比普通的FTP要低得多,如果您对网络安全性要求更高时,可以使用SFTP代替FTP。一、连接方式常用的方式有两种,一种直接采用sftp连接远端服务器IP另一种则先登录远程服务器,在开启sftp功能1、sftp [remotehost IP ]通过sftp连接[host],端口为默认的22,用户为Linux当前登录用户。?Xshell 5 (Build 0806)Copyright (c) 2002-2015 NetSarang Computer, Inc. All rights reserved.Type `help to learn how to use Xshell prompt.[c:\~]$ sftp 01Connecting to 01:22...Connection established.To escape to local shell, press Ctrl+Alt+].Your current local directory isC:\Users\FieldYang\Documents\NetSarang\Xshell\SessionsType `help to browse available commnands.sftp:/root2、sftp -oPort=[port][remotehost IP]通过sftp连接远程服务器,指定端口[port],用户为Linux当前登录用户。3、sftp[user]@[remotehost IP]通过sftp连接远程服务器,端口为默认的22,指定用户[user]。Xshell 5 (Build 0806)Copyright (c) 2002-2015 NetSarang Computer, Inc. All rights reserved.Type `help to learn how to use Xshell prompt.[c:\~]$ sftp fieldyang@01Connecting to 01:22...Connection established.To escape to local shell, press Ctrl+Alt+].Your current local directory isC:\Users\FieldYang\Documents\NetSarang\Xshell\SessionsType `help to browse available commnands.sftp:/home/fieldyang4、sftp -oPort=[port][user]@[remotehost IP]通过sftp连接[remotehost IP],端口为[port],用户为[user]。5、通过Xshell5与linux建立连接后,在图形用户面板上 窗口-传输新建文件,打开xftp的字符界面,如图,直接关闭即可打开一个sftp窗口二、用法1、基本用法sftp:/root helpbye finish your SFTP session退出sftpcd change your remote working directory更改远程服务器工作目录clearclear screen清屏exit finish your SFTP sessionexploreexplore your local directory导入本地目录get download a file from the server to your local machine从远程服务器上下载文件到本机help give help查找帮助lcd change and/or print local working directory切换本地当前工作目录lls list contents of a local directory列出本地当前目录的内容lpw
显示全部