Solved

How to transfer files with SSH?

Posted on 2004-09-18
5
240 Views
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?
Thanks
0
Comment
Question by:dissolved
5 Comments
 
LVL 17

Accepted Solution

by:
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]
0
 
LVL 6

Assisted Solution

by:blkline
blkline earned 200 total points
ID: 12093511
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
 

Author Comment

by:dissolved
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
file_to_transfer.txt

root#

Thanks guys
0
 
LVL 2

Assisted Solution

by:zuralin
zuralin earned 130 total points
ID: 12093762
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
 

Author Comment

by:dissolved
ID: 12094219
thanks guys
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

rdate is a Linux command and the network time protocol for immediate date and time setup from another machine. The clocks are synchronized by entering rdate with the -s switch (command without switch just checks the time but does not set anything). …
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
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.

744 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

12 Experts available now in Live!

Get 1:1 Help Now