Mac连接远程服务器(Linux)以及文件上传、下载命令

在windows上,用xshell+xftp就可以很方便的操作远程linux服务器了。

而这2个软件是没有mac版的,所以在macOS下,是怎样实现对远程linux服务器的操作的呢?

使用ssh连接远程主机

ssh [email protected]

使用scp命令实现上传下载


1、下载服务器 test.txt 到本地桌面

scp [email protected]:/root/test.txt /Users/mac/Desktop

2、上传本地桌面上的 test.txt 到服务器 root 目录下

scp /Users/mac/Desktop/test.txt [email protected]:/root/

3、下载服务器 root 文件夹

scp -r [email protected]:/root/ /Users/mac/Desktop/

4、上传当前本地目录下的 test 文件夹到服务器 root 目录下

scp -r test [email protected]:/root/ 

注:目标服务器要开启写入权限。

--------------------- 
作者:xuchg1 
来源:CSDN 
原文:https://blog.csdn.net/xcg132566/article/details/78797339 (内容有删改)
版权声明:本文为博主原创文章,转载请附上博文链接!

猜你喜欢

转载自blog.csdn.net/qq846294282/article/details/85778645