PDA

View Full Version : Copying files with sftp


CrackedLCD
2007-12-27, 12:18 AM CST
I know VERY little about networking, so bear with and if you can help, please dumb it down :p

I'm trying to copy files from my laptop to my pc using sftp, but I get an error:

sftp loginnameonlaptop@laptopIPaddress
loginnameonlaptop@laptopIPaddress's password:
Received message too long 170723452

what am I doing wrong?

stevea
2007-12-27, 12:32 AM CST
I'll suggest you use 'scp' instead.

OTOH it should be:
sftp root@lycoperdon:/tmp/foo1
or
scp root@lycoperdon:/tmp/foo1 .
==
I have no idea why you get that message. Try "sftp -v ...."
and scan through the debug messages.

CrackedLCD
2007-12-27, 12:55 AM CST
I tried using scp along with "-p -r" options because I want to copy an entire directory along with all it's subdirectories, but I now I get an error saying that the directory doesn't exist...

$ scp -p -r /home/username/Music root@IPaddress:~/Download
root@IPaddresses's password:
/home/username/Music: No such file or directory
$

Is there an easier to do this? Maybe through ssh?

mbratch
2007-12-27, 08:18 PM CST
I just tried that scp command format on my machine and it worked fine.

Did you check that (I know these are dumb, sorry):

(a) the target machine allows ssh access to the root account?
(b) the directory /root/Download exists?
(c) the directory /home/username/Music exists?

CrackedLCD
2007-12-28, 03:40 PM CST
(a) yes it does, i can log in just fine using ssh.
(b) should i be doing this logged in as root on BOTH machines? i was trying to copy the Music directory from my laptop top to my pc, but not as root on my pc. in otherwords, i was trying to copy to: /home/pcnonrootuser/Download, and yes THIS directory exists.
(c) yes this directory exists, I ssh'd into my laptop to make sure i was typing in the correct path.

from the book i'm reading it sounds like scp is only used to copy single files while sftp is used to copy multiple files. which one would be better to use? could the error be because it's expecting to copy a file and not a directory? the ~/Music directory i'm trying to copy holds only subdirectories, no files...