Answers:
要通过ssh传输文件,您应该使用该scp
命令。
基本用法是:
[you@localhost ~]$ scp examplefile yourusername@remoteserver:/home/yourusername/
它将通过SSH将文件复制examplefile
到该位置的远程服务器/home/yourusername/examplefile
更具体的例子:
[Moshe@localhost ~/mywork]$ scp thework.zip Moshe@192.168.1.21:/home/Moshe/
假设您的本地文件是,/home/Moshe/mywork/thework.zip
并且您有权登录到服务器192.168.1.21并在远程目录中写入/home/Moshe
您将以远程服务器/home/Moshe/thework.zip
上复制的文件结束。
如果您不是在Linux或本地任何基于Unix的系统上工作(例如,您通常在Windows上),那么像WinSCP这样的工具将使您能够借助图形界面通过SSH传输文件。