Mac 终端 SSH 文件传输?

JSh*_*hoe 13 mac ssh terminal

有没有办法仅使用终端将文件直接从 Mac 传输到另一台?也许使用SSH?

Rya*_*ons 25

是的,您可以使用 scp ,它基本上是通过 ssh 使用的 cp 。它也可以以任何一种方式工作,因此:

scp ~/Document/Localfile remoteuser@remotemachine:~/Desktop
Run Code Online (Sandbox Code Playgroud)

或者

scp remoteuser@remotemachine:~/Destkop/remotefile ~/Desktop
Run Code Online (Sandbox Code Playgroud)

第一个命令将文件复制到远程机器,第二个命令将文件从远程复制到本地。语法是<user>@<machine or ip>:<file>你可以man scp为更多的开关和选项做一个