How to transfer files with SSH?

Posted on 2004-09-18
Last Modified: 2010-08-05
Right now I am using SSH File Transfer Client gui to do all my file transfers.  Is there a way to do this from the shell?  Say I'm logged into an SSH server and want to copy a file from it. What would the command be?

What about copying a command from the local pc to the ssh server?
Question by:dissolved
LVL 17

Accepted Solution

owensleftfoot earned 170 total points
ID: 12093510
To transfer a file you would use scp - you dont have to be logged in to the ssh server to do this, just use scp with your username & password.Have a look at man scp. To run a command on the remote ssh server you would use ssh.
ssh [-l login_name] hostname | user@hostname [command]

Assisted Solution

blkline earned 200 total points
ID: 12093511
You may use "scp" to do your file copy.  Also, you can do:

cat file | ssh "cat - > file"

If you want to use only ssh.


Author Comment

ID: 12093623
Ok, I'm secure shelled into my SSH server on my lan.  I am on a windows box. How would I do this?

root#  ls


Thanks guys

Assisted Solution

zuralin earned 130 total points
ID: 12093762
To do it from a Windows box while in cmd.exe or install psftp (PuTTY SFTP) from and save it to c:\Windows\System (i think).  Then while at the prompt type "psftp -h" to get a list of options.  I think this is what you are looking for anyways.

Author Comment

ID: 12094219
thanks guys

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to get maximum transfer speed over LAN 4 80
nagios monitor 3 54
route 2 traffic streams on single NIC 6 48
Remote desktop Ubuntu from Windows 10 5 59
Daily system administration tasks often require administrators to connect remote systems. But allowing these remote systems to accept passwords makes these systems vulnerable to the risk of brute-force password guessing attacks. Furthermore there ar…
Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question