Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 253
  • Last Modified:

How to transfer files with SSH?

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?
Thanks
0
dissolved
Asked:
dissolved
3 Solutions
 
owensleftfootCommented:
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]
0
 
blklineCommented:
You may use "scp" to do your file copy.  Also, you can do:

cat file | ssh user@remote.host "cat - > file"

If you want to use only ssh.

Barry
0
 
dissolvedAuthor Commented:
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
file_to_transfer.txt

root#

Thanks guys
0
 
zuralinCommented:
To do it from a Windows box while in cmd.exe or command.com install psftp (PuTTY SFTP) from http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html 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.
0
 
dissolvedAuthor Commented:
thanks guys
0

Featured Post

Configuration Guide and Best Practices

Read the guide to learn how to orchestrate Data ONTAP, create application-consistent backups and enable fast recovery from NetApp storage snapshots. Version 9.5 also contains performance and scalability enhancements to meet the needs of the largest enterprise environments.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now