Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
335 views
in Technique[技术] by (71.8m points)

linux - 如何使用SSH从服务器下载文件? [关闭](How to download a file from server using SSH? [closed])

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.

((UBUNTU 10.04)我没有对服务器的Web访问权限,只有ssh。)

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

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

  ask by NiLL translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

In your terminal, type:

(在您的终端中,键入:)

scp [email protected]:foobar.txt /local/dir

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

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

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

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

scp -i key_file.pem [email protected]:/remote/dir/foobar.txt /local/dir

From: http://www.hypexr.org/linux_scp_help.php

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...