Secure CRT 文件传输

12 篇文章 0 订阅

Secure CRT 文件传输

Secure CRT支持多种文件传输协议,其中最常用的是Xmodem、Ymodem、Zmodem和Kermit。这些协议允许在本地计算机和远程主机之间安全地传输文件。

  1. Xmodem

    • Xmodem是一种简单的协议,通常用于在串行连接上进行文件传输。
    • 它通过逐块发送文件,并在每个数据块之后发送一个校验和来保证数据完整性。
    • Xmodem的缺点是速度较慢,并且不支持断点续传。
  2. Ymodem

    • Ymodem是Xmodem的改进版本,增加了一些功能,如支持发送多个文件和文件名。
    • 它通过发送文件列表来支持发送多个文件,从而提高了效率。
    • Ymodem支持较大的数据块,因此速度比Xmodem更快。
  3. Zmodem

    • Zmodem是一个高效的文件传输协议,支持断点续传、数据压缩和自动文件校验等功能。
    • 它能够在传输过程中动态调整数据块大小,以提高传输效率。
    • Zmodem还能够自动恢复传输中断,无需重新开始传输。
  4. Kermit

    • Kermit是一种跨平台的文件传输协议,支持在不同操作系统之间进行文件传输。
    • 它提供了可靠的数据校验和错误处理机制,确保数据的完整性。
    • Kermit还支持文件压缩和加密,以提高安全性和效率。

通常情况下,Zmodem是最常用的选择,因为它具有良好的性能和可靠性,并且支持断点续传功能。要在Secure CRT中启用文件传输,你可以通过菜单或命令行选择所需的传输协议,并根据需要配置相关参数,如端口号、传输速度等。

作者:炭烤毛蛋 ,点击博主了解更多。


提示:


CRT – lrzsz

在Linux上使用sz命令进行文件传输,通常是通过安装lrzsz软件包来实现的。sz命令用于从服务器向客户端传输文件,而rz命令则用于从客户端向服务器传输文件。

Linux发行版的包管理器安装lrzsz

sudo apt-get update
sudo apt-get install lrzsz

CRT 传输路径配置

通过"File Transfer"可以修改下载到本地的默认路径。设置默认目录:options–>session options–>X/Y/Zmodem.
XYZModem
Upload 用于存放发送文件的默认目录
Download 用于存放接收到文件的默认目录。
如果希望传输速率加快,可选用 1024 bytes。

CRT 从服务器向客户端传输文件

服务端向客户端发送文件,存储到客户端默认路径。

  • 单文件发送
sz /path/to/file.txt
  • 多文件发送
sz /path/to/file.txt /path/to/file2.txt

CRT 从客户端向服务器传输文件

客户端的Secure CRT或其他SSH客户端中执行命令 rz,默认将接收文件存储到当前目录。
如果需要修改存储路径可以指定路径,方法如下:

# rz命令指定目标目录, 路径信息替换 /path/to/target/dir
rz -bE /path/to/target/dir

服务端执行 rz命令后,Secure CRT或其他SSH客户端将会打开一个文件选择对话框,选择要传输的文件。选择完文件后,文件将会被传输到当前会话的远程服务器上。发送文件前未指定目录,文件会被传输到目标设备上的当前工作目录。
rz

CRT – sftp

SFTP(SSH 文件传输协议)是一种安全的文件传输协议,它通过 SSH(Secure Shell)协议进行加密,用于在客户端和服务器之间传输文件。SFTP 提供了对文件传输的安全性和可靠性,通常用于在本地系统和远程服务器之间安全地传输文件。

CRT 开启SFTP会话

Secure CRT启用sftp方法比较简单,先连接ssh服务器终端。按下“ALT” + “P”开启新的会话,新会话是SFTP终端。
sftp
终端可以使用命令连接 SFTP

# 连接到远程服务器,其中 username 是你的用户名,hostname 是远程服务器的主机名或 IP 地址。
sftp username@hostname

SFTP 连接服务指定端口号

# 连接到远程服务器,其中 username 是你的用户名,hostname 是远程服务器的主机名或 IP 地址,   SSH 服务器监听在非标准端口上,-P 参数指定端口号。
sftp -P port username@hostname

SFTP 传输文件操作

  • SFTP 基础命令
命令说明
cd directory进入远程服务器上的目录
lcd directory进入本地系统上的目录
ls显示当前远程服务器上的文件和目录列表
lls显示当前本地系统上的文件和目录列表
pwd显示当前远程服务器上的工作目录
lpwd显示当前本地系统上的工作目录
mkdir directory在远程服务器上创建目录
lmkdir directory在本地系统上创建目录
get remote-file [local-file]从远程服务器下载文件到本地系统
put local-file [remote-file]上传本地文件到远程服务器
rm file删除远程服务器上的文件
rmdir directory删除远程服务器上的目录(如果目录非空,需要添加 -r 参数)
rename oldpath newpath重命名或移动远程服务器上的文件或目录
quit 或 exit退出 SFTP 客户端
help 或 ?显示 SFTP 命令的帮助信息
  • SFTP 命令详细解释
help
Available commands:
ascii                          Set transfer mode to ASCII
binary                         Set transfer mode to binary
cd path                        Change remote directory to 'path'
lcd path                       Change local directory to 'path'
chgrp group path               Change group of file 'path' to 'group'
chmod mode path                Change permissions of file 'path' to 'mode'
chown owner path               Change owner of file 'path' to 'owner'
detail remote-path             Display system information about remote
                                 file or folder
ldetail local-path             Display system information about local
                                 file or folder
exit                           Quit sftp
get [-r] [-a | -b] [--nopreserve] [--move] [--no-flock] remote-path
                               Download file
                                 -r downloads directory recursively
                                 force ascii (-a) or binary (-b) mode
                                 --nopreserve the timestamp and permissions
                                   will not be preserved
                                 --move the files will be moved
                                 --no-flock disables the use of flock
help                           Display this help text
include filename               Include commands from 'filename'
                                 Alternate: < filename
ln [-s] existingpath linkpath  Hardlink / symlink remote file
ls [options] [path]            Display remote directory listing
lls [options] [path]           Display local directory listing
mkdir path                     Create remote directory
lmkdir path                    Create local directory
mv oldpath newpath             Move remote file
lmv oldpath newpath            Move local file
put [-r][-a | -b] [--nopreserve] [--move] [--no-flock] local-path
                               Upload file
                                 -r uploads directory recursively
                                 force ascii (-a) or binary (-b) mode
                                 --nopreserve the timestamp and permissions
                                   will not be preserved
                                 --move the files will be moved
                                 --no-flock disables the use of flock
pwd                            Display remote working directory
lpwd                           Print local working directory
quit                           Quit sftp
rename oldname newname         Rename remote file
lrename oldname newname        Rename local file
rm path                        Delete remote file
lrm path                       Delete local file
rmdir path                     Remove remote directory
lrmdir path                    Remove local directory
su username                    Substitutes the current user
                                 This is only supported with VShell for 
                                 Windows 3.5 or later.
type [transfer-mode]           Display or set file transfer mode
view remote-path               Download and open file
version                        Display protocol version
``

# 结语
不枉博主详细讲解,欢迎订阅博主–[炭烤毛蛋](https://blog.csdn.net/weixin_35723192?type=blog)
  • 22
    点赞
  • 17
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值