ssh file transfer?
i was wondering how can you copy a file onto a remote computer after successful ssh login... can ssh do that?
|
yep, use scp or sftp
|
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 |
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 :) |
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...
|
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 :)
|
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? |
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
|
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!
|
Quote:
Cool |
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. |
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. |