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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Over the last ten+ years I have seen Linux configuration tools come and go. In the early days there was the tried-and-true, all-powerful linuxconf that many thought would remain the one and only Linux configuration tool until the end of times. Well,…
Using 'screen' for session sharing, The Simple Edition Step 1: user starts session with command: screen Step 2: other user (logged in with same user account) connects with command: screen -x Done. Both users are connected to the same CLI sessio…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
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.

939 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

Need Help in Real-Time?

Connect with top rated Experts

1 Experts available now in Live!

Get 1:1 Help Now