LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   ssh file transfer? (https://www.linuxquestions.org/questions/linux-newbie-8/ssh-file-transfer-202503/)

Apostasy 07-08-2004 04:18 AM

ssh file transfer?
 
i was wondering how can you copy a file onto a remote computer after successful ssh login... can ssh do that?

acid_kewpie 07-08-2004 04:31 AM

yep, use scp or sftp

MasterC 07-08-2004 04:40 AM

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

Apostasy 07-08-2004 04:43 AM

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 :)

silmaril8n 07-08-2004 11:37 AM

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...

Apostasy 07-08-2004 03:10 PM

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 :)

silmaril8n 07-08-2004 06:25 PM

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?

Apostasy 07-08-2004 06:43 PM

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

silmaril8n 07-09-2004 10:21 AM

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!

MasterC 07-10-2004 03:56 AM

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

fortezza 07-30-2004 08:31 PM

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.

statmobile 07-30-2004 10:33 PM

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.



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