如何通过 telnet 使用终端从 Ubuntu 服务器复制数据?

klo*_*lox 4 linux telnet terminal file-transfer ubuntu-server

我有一个文件夹要复制,其中包含用于创建网站的 PHP 和类似文件。

如何使用终端将一个文件夹从服务器 (Linux Ubuntu) 复制到客户端 PC (Linux Ubuntu)?我可以用ftp吗?对于终端连接,我使用 Telnet。

服务器上的文件夹位置:

qa@ubuntu:~/www/html/js 
Run Code Online (Sandbox Code Playgroud)

我想将它复制到客户端:

qa@desktop2:~/home/qa/html
Run Code Online (Sandbox Code Playgroud)

小智 5

如果您在远程计算机上运行 ssh 服务器,则可以使用 scp(无论如何都是一件好事)。Telnet 不好,它未加密且麻烦。

由于我假设您可以通过 ssh 连接到远程机器,因此使用 scp 的基本方法是:

scp -r ~/www/html/js qa@desktop2:~/home/qa/html/js
Run Code Online (Sandbox Code Playgroud)

假设你要复制qa@ubuntu:~/www/html/jsqa@desktop2:~/home/qa/html/js SCP是非常强大的,所以我建议在阅读手册页它

man scp
Run Code Online (Sandbox Code Playgroud)