linux - [Solved-3 Solutions] How to download a file from server using SSH in Linux - ubuntu - red hat - debian - linux server - linux pc




Linux - Problem :

How to download a file from server using SSH in Linux ?

Linux - Solution 1:

In your terminal, type:

scp [email protected]:foobar.txt /local/dir
click below button to copy the code. By - Linux tutorial - team

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

If you want to access EC2 , use the -i option:

scp -i key_file.pem [email protected]:/remote/dir/foobar.txt /local/dir
click below button to copy the code. By - Linux tutorial - team

Linux - Solution 2:

You can do this with the scp command. scp uses the SSH protocol to copy files across system by extending the syntax of cp.

Copy something from this system to some other system:

scp /path/to/local/file [email protected]:/path/to/remote/file    
click below button to copy the code. By - Linux tutorial - team

Copy something from some system to some other system:

scp [email protected]:/path/to/file [email protected]:/path/to/other/file 
click below button to copy the code. By - Linux tutorial - team

Copy something from another system to this system:

scp [email protected]:/path/to/remote/file /path/to/local/file
click below button to copy the code. By - Linux tutorial - team

Linux - Solution 3:

$ ssh host 'cat /path/on/remote' > /path/on/local
click below button to copy the code. By - Linux tutorial - team

or

$ cat /path/on/local | ssh host 'cat > /path/on/remote'
click below button to copy the code. By - Linux tutorial - team

Note, this is UUOC, but < /path/on/local ssh host 'cat > /path' could cause unnecessary confusion.

And to proxy between two hosts:

$ ssh host1 'cat /path/on/host1' | ssh host2 'cat > /path/on/host2'
click below button to copy the code. By - Linux tutorial - team

Related Searches to - linux - linux tutorial - How to download a file from server using SSH in Linux

Adblocker detected! Please consider reading this notice.

We've detected that you are using AdBlock Plus or some other adblocking software which is preventing the page from fully loading.

We don't have any banner, Flash, animation, obnoxious sound, or popup ad. We do not implement these annoying types of ads!

We need money to operate the site, and almost all of it comes from our online advertising.

Please add wikitechy.com to your ad blocking whitelist or disable your adblocking software.

×