如何使用SSH从服务器下载文件? [英] How to download a file from server using SSH?

查看:399
本文介绍了如何使用SSH从服务器下载文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要将文件从服务器下载到我的桌​​面. (UBUNTU 10.04)我没有Web访问服务器,只有ssh.

I need to download a file from server to my desktop. (UBUNTU 10.04) I don't have a web access to the server, just ssh.

如果有帮助,我的操作系统是Mac OS X和iTerm 2作为终端.

If it helps, my OS is Mac OS X and iTerm 2 as a terminal.

推荐答案

在您的终端中,输入:

scp your_username@remotehost.edu:foobar.txt /local/dir

根据需要替换用户名,主机,远程文件名和本地目录.

replacing the username, host, remote filename, and local directory as appropriate.

如果要访问EC2(或其他需要使用私钥进行身份验证的服务),请使用-i选项:

If you want to access EC2 (or other service that requires authenticating with a private key), use the -i option:

scp -i key_file.pem your_username@remotehost.edu:/remote/dir/foobar.txt /local/dir

来自: http://www.hypexr.org/linux_scp_help.php

这篇关于如何使用SSH从服务器下载文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆