linux – 如何在已经进入的服务器上下载文件?

前端之家收集整理的这篇文章主要介绍了linux – 如何在已经进入的服务器上下载文件?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我知道如何使用scp或wget将远程服务器上的文件下载到本地计算机.但是,如果我已经使用ssh登录到服务器,是否有一个命令允许我将服务器上的pwd中的文件下载到本地计算机上?

我想我可以使用scp,但我的本地机器通常在路由器后面.我必须在路由器中打开一个端口吗?

解决方法

您需要回答的是为什么您不想再次登录…如果您记录一次,您可以记录两次…特别是如果您花了三分钟创建密钥并远程存储密钥:
  1. $ssh-keygen
  2. Generating public/private rsa key pair.
  3. Enter file in which to save the key (/home/user/.ssh/id_rsa):
  4. Enter passphrase (empty for no passphrase):
  5. Enter same passphrase again:
  6. Your identification has been saved in /home/user/.ssh/id_rsa.
  7. Your public key has been saved in /home/user/.ssh/id_rsa.pub.
  8. The key fingerprint is:
  9. 2b:4c:11:ab:53:d1:15:90:4f:88:a1:42:da:c5:1c:98 user@localhost
  10. $ssh-copy-id user@remotehost
  11. Warning: Permanently added 'remotehost' (RSA) to the list of known hosts.
  12. Password:
  13. $ssh user@remotehost
  14. Last login: Mon Dec 14 21:52:45 2009 from 1.2.3.4
  15. [user@remotehost] $

回到TCP / IP普及之前的时代,人们使用像X / Modem这样的kludges来处理这个问题.现在使用它有点傻.

猜你在找的Linux相关文章