用过windows的朋友都知道,连接Linux服务器的时候需要用xshell及xftp来传输文件
但是xshell没有mac版 ,当然也有其它软件工具来连接传输使用 今天来介绍下使用Mac自带的终端来连接传输。
1 首先搜索到终端 如下图:
![](https://i-blog.csdnimg.cn/blog_migrate/dbf00cdb63b4d4ae29bcbc65eb4c99ef.jpeg)
![](https://i-blog.csdnimg.cn/blog_migrate/dda801412c0a91865941f82797892493.webp?x-image-process=image/format,png)
2 然后右键之后出现如下图所示,选择新建远程连接
![](https://i-blog.csdnimg.cn/blog_migrate/358aec886488419e7c737d7acb565995.jpeg)
![](https://i-blog.csdnimg.cn/blog_migrate/24ab0fdc79d95e6aa02c12078aeb2050.webp?x-image-process=image/format,png)
3 开始连接服务器 连接服务器选择安全shell 传输文件选择sftp协议
![](https://i-blog.csdnimg.cn/blog_migrate/44d0efd197422a1bba660a062959ba57.jpeg)
![](https://i-blog.csdnimg.cn/blog_migrate/06d3f7e85239d83de3d1ebdd0fc81d03.webp?x-image-process=image/format,png)
4 添加服务器IP如下图所示
![](https://i-blog.csdnimg.cn/blog_migrate/90d378431a41e2d27f9ca53caf707fc7.jpeg)
![](https://i-blog.csdnimg.cn/blog_migrate/f6359103c36b8457ab4c68eeb578f6a7.webp?x-image-process=image/format,png)
添加完之后点击 好 按钮确定 然后点击下方连接 跳出如下图所示窗口:
![](https://i-blog.csdnimg.cn/blog_migrate/5c0db97399ee652d9ebed2a23feda2c7.jpeg)
![](https://i-blog.csdnimg.cn/blog_migrate/872c1d8dd91e9a375b228da655bb6596.webp?x-image-process=image/format,png)
注意⚠️:password后面填写密码的话这里是不显示的 直接填入之后enter就可以了
然后就连接到Linux服务器了,命令都是一样的
下面再说一下使用终端来传输文件的连接,连接方式都一样协议选择步骤3当中的sftp就行,后续操作都是一样的输入账号密码就OK
连接成功之后如下图
![](https://i-blog.csdnimg.cn/blog_migrate/76c61bdc1d1e718704d646ce7e518ef4.jpeg)
![](https://i-blog.csdnimg.cn/blog_migrate/634b6777ec42d87302c77580db6c9052.webp?x-image-process=image/format,png)
然后使用命令: put 你需要上传文件在本地的路径 上传到服务器的路径
然后enter就成功了