想用SecureCRT向linux服务器传输文件其实很简单,只需要在对应的linux服务器上安装一个叫做lrzsz的工具即可实现传输。
该工具可以实现从Windows各个版本和Mac OS X各个版本上使用。(只要能用SecureCRT就可以用该工具)
以下针对CentOS(redhat一样)与Ubuntu linux做一个实验:
我本地的SecureCRT环境:Windows 10 64位
CentOS版本(6.5):
直接通过yum就可以安装了,某些老的系统可能需要更新yum源,或者源码安装。
[op@sAno1y ~]$ sudo yum install lszrz
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
* base: mirrors.pubyun.com
* extras: mirrors.163.com
* updates: mirrors.163.com
Setting up Install Process
No package lszrz available.
Error: Nothing to do
[op@sAno1y tar_packages]$ sudo yum install lrzsz
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
* base: mirrors.pubyun.com
* extras: mirrors.163.com
* updates: mirrors.skyshe.cn
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package lrzsz.x86_64 0:0.12.20-27.1.el6 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=================================================================================================
Package Arch Version Repository Size
=================================================================================================
Installing:
lrzsz x86_64 0.12.20-27.1.el6 base 71 k
Transaction Summary
=================================================================================================
Install 1 Package(s)
Total download size: 71 k
Installed size: 159 k
Is this ok [y/N]: y
Downloading Packages:
lrzsz-0.12.20-27.1.el6.x86_64.rpm | 71 kB 00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : lrzsz-0.12.20-27.1.el6.x86_64 1/1
Verifying : lrzsz-0.12.20-27.1.el6.x86_64 1/1
Installed:
lrzsz.x86_64 0:0.12.20-27.1.el6
Complete!
此时输入rz就可以从Windows向linux里上传文件了。( linux目标路径为当前目录)
比如:
[op@sAno1y ~]$ rz
rz waiting to receive.
Starting zmodem transfer. Press Ctrl+C to cancel.
Transferring mysql-5.6.26.tar.gz...
100% 32498 KB 8124 KB/sec 00:00:04 0 Errors
另外一个命令为sz,sz为从linux上向本地(Windows)下载文件。
其默认下载目录为C:\Users\username\Downloads
用法极其简单,比如:
[op@sAno1y ~]$ sz aaa
rz
Starting zmodem transfer. Press Ctrl+C to cancel.
Transferring aaa...
其中aaa是需要下载到本地的文件名。
若要修改本地下载和上传的目录,需要修改SecureCRT的设置:
在Windows下:
Options--Session Options--Terminal--X/Y/Zmodem 修改upload和download的路径即可。
在Mac OS X下与其类似。
下载命令(sz)用法如下 :
Ubuntu版本(12.04.5):
此处不再赘述,简单的通过包管理工具apt-get就可以安装了。
sAno1y@localhost:~$ sudo apt-get install lrzsz
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
minicom
The following NEW packages will be installed:
lrzsz
0 upgraded, 1 newly installed, 0 to remove and 100 not upgraded.
2 not fully installed or removed.
Need to get 111 kB of archives.
After this operation, 295 kB of additional disk space will be used.
Get:1 http://mirrors.aliyun.com/ubuntu/ precise/universe lrzsz amd64 0.12.21-5 [111 kB]
Fetched 111 kB in 0s (3,856 kB/s)
Selecting previously unselected package lrzsz.
(Reading database ... 55965 files and directories currently installed.)
Unpacking lrzsz (from .../lrzsz_0.12.21-5_amd64.deb) ...
Processing triggers for man-db ...
Setting up qmail (1.06-4) ...
The hostname -f command returned: $1
Your system needs to have a fully qualified domain name (fqdn) in
order to install the var-qmail packages.
Installation aborted.
dpkg: error processing qmail (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of qmail-run:
qmail-run depends on qmail (>= 1.06-2.1); however:
Package qmail is not configured yet.
dpkg: error processing qmail-run (--configure):
dependency problems - leaving unconfigured
Setting up lrzsz (0.12.21-5) ...
No apport report written because the error message indicates its a followup error from a previous failure.
Errors were encountered while processing:
qmail
qmail-run
E: Sub-process /usr/bin/dpkg returned an error code (1)
在Mac OS X下的SecureCRT用法类似(已测试)。
该工具可以实现从Windows各个版本和Mac OS X各个版本上使用。(只要能用SecureCRT就可以用该工具)
以下针对CentOS(redhat一样)与Ubuntu linux做一个实验:
我本地的SecureCRT环境:Windows 10 64位
CentOS版本(6.5):
直接通过yum就可以安装了,某些老的系统可能需要更新yum源,或者源码安装。
[op@sAno1y ~]$ sudo yum install lszrz
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
* base: mirrors.pubyun.com
* extras: mirrors.163.com
* updates: mirrors.163.com
Setting up Install Process
No package lszrz available.
Error: Nothing to do
[op@sAno1y tar_packages]$ sudo yum install lrzsz
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
* base: mirrors.pubyun.com
* extras: mirrors.163.com
* updates: mirrors.skyshe.cn
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package lrzsz.x86_64 0:0.12.20-27.1.el6 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=================================================================================================
Package Arch Version Repository Size
=================================================================================================
Installing:
lrzsz x86_64 0.12.20-27.1.el6 base 71 k
Transaction Summary
=================================================================================================
Install 1 Package(s)
Total download size: 71 k
Installed size: 159 k
Is this ok [y/N]: y
Downloading Packages:
lrzsz-0.12.20-27.1.el6.x86_64.rpm | 71 kB 00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : lrzsz-0.12.20-27.1.el6.x86_64 1/1
Verifying : lrzsz-0.12.20-27.1.el6.x86_64 1/1
Installed:
lrzsz.x86_64 0:0.12.20-27.1.el6
Complete!
此时输入rz就可以从Windows向linux里上传文件了。( linux目标路径为当前目录)
比如:
[op@sAno1y ~]$ rz
rz waiting to receive.
Starting zmodem transfer. Press Ctrl+C to cancel.
Transferring mysql-5.6.26.tar.gz...
100% 32498 KB 8124 KB/sec 00:00:04 0 Errors
另外一个命令为sz,sz为从linux上向本地(Windows)下载文件。
其默认下载目录为C:\Users\username\Downloads
用法极其简单,比如:
[op@sAno1y ~]$ sz aaa
rz
Starting zmodem transfer. Press Ctrl+C to cancel.
Transferring aaa...
其中aaa是需要下载到本地的文件名。
若要修改本地下载和上传的目录,需要修改SecureCRT的设置:
在Windows下:
Options--Session Options--Terminal--X/Y/Zmodem 修改upload和download的路径即可。
在Mac OS X下与其类似。
下载命令(sz)用法如下 :
- sz version 0.12.20
- Usage: sz [options] file ...
- or: sz [options] -{c|i} COMMAND
- Send file(s) with ZMODEM/YMODEM/XMODEM protocol
- (X) = option applies to XMODEM only
- (Y) = option applies to YMODEM only
- (Z) = option applies to ZMODEM only
- -+, --append append to existing destination file (Z)
- -2, --twostop use 2 stop bits
- -4, --try-4k go up to 4K blocksize
- --start-4k start with 4K blocksize (doesn't try 8)
- -8, --try-8k go up to 8K blocksize
- --start-8k start with 8K blocksize
- -a, --ascii ASCII transfer (change CR/LF to LF)
- -b, --binary binary transfer
- -B, --bufsize N buffer N bytes (N==auto: buffer whole file)
- -c, --command COMMAND execute remote command COMMAND (Z)
- -C, --command-tries N try N times to execute a command (Z)
- -d, --dot-to-slash change '.' to '/' in pathnames (Y/Z)
- --delay-startup N sleep N seconds before doing anything
- -e, --escape escape all control characters (Z)
- -E, --rename force receiver to rename files it already has
- -f, --full-path send full pathname (Y/Z)
- -i, --immediate-command CMD send remote CMD, return immediately (Z)
- -h, --help print this usage message
- -k, --1k send 1024 byte packets (X)
- -L, --packetlen N limit subpacket length to N bytes (Z)
- -l, --framelen N limit frame length to N bytes (l>=L) (Z)
- -m, --min-bps N stop transmission if BPS below N
- -M, --min-bps-time N for at least N seconds (default: 120)
- -n, --newer send file if source newer (Z)
- -N, --newer-or-longer send file if source newer or longer (Z)
- -o, --16-bit-crc use 16 bit CRC instead of 32 bit CRC (Z)
- -O, --disable-timeouts disable timeout code, wait forever
- -p, --protect protect existing destination file (Z)
- -r, --resume resume interrupted file transfer (Z)
- -R, --restricted restricted, more secure mode
- -q, --quiet quiet (no progress reports)
- -s, --stop-at {HH:MM|+N} stop transmission at HH:MM or in N seconds
- --tcp build a TCP connection to transmit files
- --tcp-server open socket, wait for connection
- -u, --unlink unlink file after transmission
- -U, --unrestrict turn off restricted mode (if allowed to)
- -v, --verbose be verbose, provide debugging information
- -w, --windowsize N Window is N bytes (Z)
- -X, --xmodem use XMODEM protocol
- -y, --overwrite overwrite existing files
- -Y, --overwrite-or-skip overwrite existing files, else skip
- --ymodem use YMODEM protocol
- -Z, --zmodem use ZMODEM protocol
此处不再赘述,简单的通过包管理工具apt-get就可以安装了。
sAno1y@localhost:~$ sudo apt-get install lrzsz
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
minicom
The following NEW packages will be installed:
lrzsz
0 upgraded, 1 newly installed, 0 to remove and 100 not upgraded.
2 not fully installed or removed.
Need to get 111 kB of archives.
After this operation, 295 kB of additional disk space will be used.
Get:1 http://mirrors.aliyun.com/ubuntu/ precise/universe lrzsz amd64 0.12.21-5 [111 kB]
Fetched 111 kB in 0s (3,856 kB/s)
Selecting previously unselected package lrzsz.
(Reading database ... 55965 files and directories currently installed.)
Unpacking lrzsz (from .../lrzsz_0.12.21-5_amd64.deb) ...
Processing triggers for man-db ...
Setting up qmail (1.06-4) ...
The hostname -f command returned: $1
Your system needs to have a fully qualified domain name (fqdn) in
order to install the var-qmail packages.
Installation aborted.
dpkg: error processing qmail (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of qmail-run:
qmail-run depends on qmail (>= 1.06-2.1); however:
Package qmail is not configured yet.
dpkg: error processing qmail-run (--configure):
dependency problems - leaving unconfigured
Setting up lrzsz (0.12.21-5) ...
No apport report written because the error message indicates its a followup error from a previous failure.
Errors were encountered while processing:
qmail
qmail-run
E: Sub-process /usr/bin/dpkg returned an error code (1)
在Mac OS X下的SecureCRT用法类似(已测试)。
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/29773961/viewspace-1794475/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/29773961/viewspace-1794475/