LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-08-2004, 04:18 AM   #1
Apostasy
Member
 
Registered: Jun 2004
Location: Wisconsin
Distribution: Ubuntu
Posts: 31

Rep: Reputation: 15
Question ssh file transfer?


i was wondering how can you copy a file onto a remote computer after successful ssh login... can ssh do that?
 
Old 07-08-2004, 04:31 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
yep, use scp or sftp
 
Old 07-08-2004, 04:40 AM   #3
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613

Rep: Reputation: 69
Just to further that, I remembering having a rough time figuring out how to use scp at first. The man should explain it pretty well, but even then, it can seem a little geek-speak-ish, try wading through it, but here's an example of copying a file from inside a lan with private ip's 192.168.1.50 and 192.168.1.25 and I'm copying a file from the computer I'm on that has the IP 192.168.1.25:
scp 192.168.1.25:/home/files/file.avi 192.168.1.50:/home/files/file.avi

Which if you pull out all the 'gugu' then you can actually see the cp command:
cp /home/files/file.avi /home/files/file.avi

Obviously that wouldn't work because it's the same box, however, it does of course using scp because of the 2 different boxes.

Cool
 
Old 07-08-2004, 04:43 AM   #4
Apostasy
Member
 
Registered: Jun 2004
Location: Wisconsin
Distribution: Ubuntu
Posts: 31

Original Poster
Rep: Reputation: 15
could you be more specific?
after i ssh -l root <host> and get to the prompt.. how would i move /home/me/file.ext from my computer to /home/me/ on the target machine?

<edit>oops.. didn't see that previous post in time
 
Old 07-08-2004, 11:37 AM   #5
silmaril8n
Member
 
Registered: May 2004
Posts: 123

Rep: Reputation: 15
This is cool! I didn't know a file transfer could be so easy. Is there a limitation to the size? For instance, I just loaded up another PC here with Linux and I want to move all my data over to it. Would I be able to tar the profile data that I want and move it across using SSH? Potentially some of the file (email) could be over 100MB...
 
Old 07-08-2004, 03:10 PM   #6
Apostasy
Member
 
Registered: Jun 2004
Location: Wisconsin
Distribution: Ubuntu
Posts: 31

Original Poster
Rep: Reputation: 15
ahh.. thx for the help.. i got it working.. had a little trouble in that hosts.deny was denying everything but localhost... but fixed that
 
Old 07-08-2004, 06:25 PM   #7
silmaril8n
Member
 
Registered: May 2004
Posts: 123

Rep: Reputation: 15
When I try to do this I get the following:

ben@cmc:~$ scp ben@10.50.0.5:/home/ben/Crown.tar.gz ben@10.50.0.6:/home/ben/Crown.tar.gz
ben@10.50.0.5's password:
Permission denied, please try again.
Permission denied, please try again.
Permission denied (publickey,password,keyboard-interactive).
lost connection
ben@cmc:~$

What gives?
 
Old 07-08-2004, 06:43 PM   #8
Apostasy
Member
 
Registered: Jun 2004
Location: Wisconsin
Distribution: Ubuntu
Posts: 31

Original Poster
Rep: Reputation: 15
i noticed that too early on.. it seemed to go away after i disabled RSA authentication in sshd settings.. apparently when using RSA you have to send along a seed with a password.. or something.. i don't fully understand it.. some sort of security function.. something to do with 'key' files too

Last edited by Apostasy; 07-08-2004 at 06:45 PM.
 
Old 07-09-2004, 10:21 AM   #9
silmaril8n
Member
 
Registered: May 2004
Posts: 123

Rep: Reputation: 15
Thanks, I'll check that out. I was able to get it work finally by using sftp which was much easier (for me) and achieved the same results. Still - this is a feature that I hadn't considered that I could do with Linux - I'm very impressed!
 
Old 07-10-2004, 03:56 AM   #10
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613

Rep: Reputation: 69
Quote:
Originally posted by silmaril8n
This is cool! I didn't know a file transfer could be so easy. Is there a limitation to the size? For instance, I just loaded up another PC here with Linux and I want to move all my data over to it. Would I be able to tar the profile data that I want and move it across using SSH? Potentially some of the file (email) could be over 100MB...
AFAIK there is no limit on single file size wrt to ssh or scp (which IIRC is simply cp wrapped up in ssh). Your file system would be the only thing puting a damper on your fun, but 100MB shouldn't be a problem with that. You really wouldn't even have to tar the profile data, you could simply copy it over recursively using the -a or similar switch...

Cool
 
Old 07-30-2004, 08:31 PM   #11
fortezza
Member
 
Registered: Mar 2003
Location: Colorado
Distribution: Fedora Core 4
Posts: 297

Rep: Reputation: 30
Hidden Files?

I just completed a "scp -rpv" file copy and it skipped over the hidden files. Since this is for a user transfer to a newly built linux box, I need all of the files transferred, including hidden. I didn't see a switch to enable this in the man file. Does anyone know if it is possible to get these files, too?

Thanks in advance.
 
Old 07-30-2004, 10:33 PM   #12
statmobile
Member
 
Registered: Aug 2003
Location: Chapel Hill, NC
Distribution: Gentoo, Windows 95 2000 & XP
Posts: 160

Rep: Reputation: 30
I'm sorry, could you be more clear about "hidden files", fortezza?

And one quick thing for the newbies:
I use sftp for transferring a few files (just a simple "get <filename>" or "put <filename>"

If I need to transfer directories, I use scp (just a simple "scp -r <local directory> <distant host>:<exact location from root />")

That's how I compare the two, even though they are more or less the same thing.

I have heard a lot about rsync as well, but that is for another time, and another post.


Last edited by statmobile; 07-30-2004 at 10:37 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
file transfer over ssh? jme Linux - Software 5 11-13-2006 01:30 AM
ssh -X and data transfer limits biophysics Linux - Software 2 04-07-2005 01:29 PM
File transfer with SSH? Baix Linux - Newbie 5 01-28-2005 06:24 PM
Can you transfer files over ssh? Thaidog Linux - Software 2 04-08-2004 10:29 PM
file transfer over ssh restrict directory browsing niall0s Linux - General 11 09-11-2003 02:50 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:18 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration