linux 机器之间 zssh, rz, sz互相传输

来源:互联网 发布:iphone手机测评软件 编辑:程序博客网 时间:2024/06/09 18:19

zssh 用法是: 像用ssh命令一样用zssh登录主机; 在命令输入状态中按下ctrl+2(@键)进入zssh状态; $sz 本地文件名 [可选参数-be:二进制方式] 上传文件完成(我在用时输出了一些乱码,但没影响上传) 下载是反出来的,先sz文件再ctrl+2再输入rz

 

更新:在archlinux上安装zssh须在AUR中找包,安装时依赖没有解决好,还需要安装lrzsz,否则在下载文件时会报:execvp rz zssh,同时整个终端挂掉。

 

To install zssh just follow these instructions. which first check that the universe repository is enabled and then installs the package for you

 

To enable the universe Repository

 

Edit the /etc/apt/sources.list file as root

C代码  收藏代码
  1. sudo gedit /etc/apt/sources.list  

 

and make sure that the universe component is included in the source lines.

It should look like this

C代码  收藏代码
  1. deb http://http.us.debian.org/debian squeeze main universe  

 

After any changes you should run

C代码  收藏代码
  1. sudo apt-get update  

 

You can now install as below.

 

Install zssh

 

C代码  收藏代码
  1. sudo apt-get install zssh  

 

Which will install zssh and 4 dependencies.


 

  • lrzsz
  • openssh-client | telnet | telnet-ssl
  • libc6 (>= 2.4)
  • libreadline6 (>= 6.0)

 

Problems?

 

You can always uninstall zssh again by following these instructions.

ubuntu saucy install package

 

Uninstall just zssh

C代码  收藏代码
  1. sudo apt-get remove zssh  
 

This will remove just the zssh package itself.

 

Uninstall zssh and dependencies

C代码  收藏代码
  1. sudo apt-get remove --auto-remove zssh  
 

This will remove the zssh package and any other packages on which it alone depends.

 

Purging your config/data too

Purged config/data can not be restored by reinstalling the package.

If you also want to delete your local/config files for zssh then you should swap remove for purge like this:

C代码  收藏代码
  1. sudo apt-get purge zssh  

 

Or again, like this:

C代码  收藏代码
  1. sudo apt-get purge --auto-remove zssh  

 

来源:installion.co.uk/ubuntu/saucy/universe/z/zssh/install.html‎

 

zssh的全名叫ZMODEM SSH.看名字就知道,使用的zmodem,我们习惯了SecureCRT,直接就可以用来发送文件,比使用scp方便很多。

zmodem协议方便主要表示在以下点

其一,不需要输入很长的命令和密码,直接使用rz,sz加文件名,就能实现文件的收发。速度还很快。

其二,在中转了一台主机时,要在目标主机和本地主机之类,要传送文件,scp相当的麻烦,需要输入多次命令用户密码.但sz直接可以穿透。

好了,讲使用,如下,和使用ssh完全一样,只是打命令时,变成了zssh

下面针对的是本地机器的

1、访问远端机器,将本地文件上传给远端机器

C代码  收藏代码以用户名root远程访问192.168.1.1机器,连接之后输入密码即可
  1. #zssh root@192.168.1.1  

 好了,在进入后,你需要将本地文件上传给远端机器的话。

C代码  收藏代码
  1. #ctrl+@  //输入该命令进入ssh下面
  2. zssh >//这里切换到了本地机器  
  3. zssh>pwd //看一下本地机器的目录在那  
  4. zssh>ls  //看一下有那些文件  
  5. zssh>sz 123.txt  //上传本地机器的当前目录的123.txt到远程机器的当前目录  

 

2、从远端机器下载文件到本地的话

Java代码  收藏代码
  1. #sz filename  //在远程机器上输入这段命令, 准备发送文件  
  2. #看到一堆乱码  
  3. #ctrl+@       //然后输入该命令进入ssh下面
  4. zssh > pwd  //看看在那个目录,cd 切换到合适的目录 再输入下面命令解释远端的文件 
  5. zssh > rz //接住对应的文件  

 

更多命令查看:http://zssh.sourceforge.net/

来源:http://www.cnblogs.com/strikebone/p/3454679.html

0 0
原创粉丝点击