![927f75ed31d9267c1c582847787cd3f2.png](https://i-blog.csdnimg.cn/blog_migrate/2e106cffc4a91f2561755eb7100cd9f1.png)
有些时候由于服务器的安全问题,可能不允许使用 ftp、sftp 只能使用 ssh 的方式,但是要上传文件在 osx 的终端却无法使用常用的 rz、sz 软件就很蛋痛了。
xshell 又没有 mac 的版本。
于是为了解决问题我查了好多资料发现都很老而且里面的地址都是错误的。
那么下面来教你如何解决这个问题
首先需要准备这些软件
iTerm2、brew、lrzsz(需要用brew安装)
第一步 下载 iTerm2
第二步 如果没有 brew 下载 brew
第三步 安装 lrzsz
brew install lrzsz
ln -s /usr/local/Cellar/lrzsz/0.12.20/bin/sz
ln -s /usr/local/Cellar/lrzsz/0.12.20/bin/rz
0.12.20 更改为具体的版本 0.12.21 -> ln -s /usr/local/Cellar/lrzsz/0.12.21/bin/rz
第四步 下载 ZModem 脚本到 /usr/local/bin/
xer0x/iterm2-zmodemgithub.com![9d3b0372d46a64b602bdcb7151aab52d.png](https://i-blog.csdnimg.cn/blog_migrate/7c403a47fe0c39e6c35aed4dcb30df21.jpeg)
然后赋予权限
[/us/local/bin/]$ chmod 777 /usr/local/bin/iterm2-*
第五步添加 rz sz 触发器
![59473418b62d76e65d370d3402fb8f42.png](https://i-blog.csdnimg.cn/blog_migrate/3f3e8c8df57de80edd8508d3d53c0404.jpeg)
然后添加
![84142707b849966f9e6cc523915541f3.png](https://i-blog.csdnimg.cn/blog_migrate/0e0051a4590199bff5c6b58d8c634dcc.jpeg)
就可以使用了!
重新打开
iTerm2 输入
ssh -p**** user@ip
rz
![4e4c19c8f59da0a5be1d951986e2e491.png](https://i-blog.csdnimg.cn/blog_migrate/c20e9635415d8193bc4db72ff78f11e3.jpeg)