Mac連線遠端伺服器(Linux)以及檔案上傳、下載命令
阿新 • • 發佈:2019-01-05
在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 (內容有刪改)
版權宣告:本文為博主原創文章,轉載請附上博文連結!