首页 > 服务器 > Linux下rz,sz与ssh的配合使用

Linux下rz,sz与ssh的配合使用

2009年12月10号
查看评论 发表评论 407次浏览

一般来说,linux服务器大多是通过ssh客户端来进行远程的登陆和管理的,使用ssh登陆linux主机以后,如何能够快速的和本地机器进行文件的交互呢,也就是上传和下载文件到服务器和本地;
与ssh有关的两个命令可以提供很方便的操作:
   sz:将选定的文件发送(send)到本地机器
   rz:运行该命令会弹出一个文件选择窗口,从本地选择文件上传到服务器(receive)


rz,sz是便是Linux/Unix同Windows进行ZModem文件传输的命令行工具

windows端需要支持ZModem的telnet/ssh客户端(比如SecureCRT)

运行命令rz,即是接收文件,SecureCRT就会弹出文件选择对话框,选好文件之后关闭对话框,文件就会上传到当前目录

注意:单独用rz会有两个问题:上传中断、上传文件变化(md5不同),解决办法是上传是用rz -be,并且去掉弹出的对话框中“Upload files as ASCII”前的勾选。
-b binary 用binary的方式上传下载,不解释字符为ascii
-e 强制escape 所有控制字符,比如Ctrl+x,DEL等

运行命令sz file1 file2就是发文件到windows上(保存的目录是可以配置) 比ftp命令方便多了,而且服务器不用再开FTP服务了

PS:Linux上rz/sz这两个小工具安装lrzsz-x.x.xx.rpm即可。
当然,还可以设置一下目录了:
设置一下上传和下载的默认目录
options–>session options–>file transfer 下可以设置上传和下载的目录
剩下的你只要在用SecureCRT登陆linux终端的时候:
发送文件到客户端:sz filename
zmodem接收可以自行启动.
从客户端上传文件到linux服务端:
只要服务端执行 : rz
然后在 SecureCRT 里选文件发送,协议 zmodem

类别服务器 标签
  1. generic cialis
    发表于 2009年12月13号 22时59分34秒 | 1楼

    Hmm… I read blogs on a similar topic, but i never visited your blog. I added it to favorites and i’ll be your constant reader.

  2. 小朋
    发表于 2009年12月13号 23时26分04秒 | 2楼

    博主模板很漂亮!

  3. 金玉
    发表于 2009年12月14号 09时01分56秒 | 3楼

    博主的模板很漂亮。

  4. levitra online
    发表于 2009年12月16号 02时49分47秒 | 4楼

    I added your blog to bookmarks. And i’ll read your articles more often!

  5. 美女照片
    发表于 2009年12月16号 12时28分09秒 | 5楼

    路过~~~~

  6. ghd hair
    发表于 2010年06月13号 18时12分00秒 | 6楼

    Ooh!! I must remember this one!!

  7. sexy lacoste swimwear
    发表于 2010年06月27号 04时24分41秒 | 7楼

    YOU. ARE. INSPIRATION.

  8. cheap mbt shoes
    发表于 2010年06月27号 17时23分00秒 | 8楼

    I’m so glad to have a great time.

  9. bikinis girls
    发表于 2010年06月28号 08时47分50秒 | 9楼

    Today is a gift and I will use it memorably way and thanks for reminding it once again

  10. puma sneakers
    发表于 2010年06月28号 09时14分06秒 | 10楼

    This is an important topic that needs more attention.

  11. Lacoste Shoes 2010
    发表于 2010年06月29号 04时44分26秒 | 11楼

    keep up the good work!!

  12. Replica Anna Corinna handbags
    发表于 2010年06月29号 09时01分05秒 | 12楼

    The magic!! Making God’s presence felt!

  13. jordan 2010
    发表于 2010年06月29号 10时21分57秒 | 13楼

    Happy listening – and it’s straight from my heart.

  14. vibram five finger
    发表于 2010年06月30号 09时58分26秒 | 14楼

    It makes sense to me lol

  15. sterling silver earrings
    发表于 2010年06月30号 12时10分57秒 | 15楼

    The thought of going on really appeals to me.

评论页数:
1 2 3 4 291