LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   SCP to copy files using putty (https://www.linuxquestions.org/questions/linux-newbie-8/scp-to-copy-files-using-putty-900640/)

JJJCR 09-01-2011 09:09 PM

SCP to copy files using putty
 
hi, i tried to use scp to copy files from my centos box to my win xp machine but there's an error.
Name or service not known.

I'm using putty to connect to my centos box.

Here's the command i used:

scp -r root@192.168.1.3:/root/Desktop/iptables.txt c:\testing\iptables.txt

any help is greatly appreciated, thanks.

andrewthomas 09-01-2011 09:29 PM

Quote:

-r Recursively copy entire directories.
Why are you using -r with a file?

JJJCR 09-01-2011 10:08 PM

hi andrewthomas, but i tried using this command:
scp root@192.168.1.3:/root/Desktop/iptables.txt c:\testing\iptables.txt

i still have error: Name or service not known

sorry about this just starting to learn linux. ;)

any ideas? thanks.

chrism01 09-01-2011 11:34 PM

If you are logged into your Centos box and running the cmd there, its saying there is no ssh daemon/service running (listening) on the MS box (possibly also the firewall on the MS box is blocking that cxn on port 22).

OTOH, if you are on the Centos box, you don't need 'root@...' part.

If you are on the MS box, cd to c:\testing and try

Code:

scp root@192.168.1.3:/root/Desktop/iptables.txt  .
although allowing remote root access is frowned upon for security reasons.
On MS cmd line I usually use pscp, part of Putty https://secure.wikimedia.org/wikipedia/en/wiki/PuTTY

Again, if it says no such service, check sshd is running on Centos and check iptables (firewall)

HTH

JJJCR 09-02-2011 03:16 AM

hi chrism01,i'm not able to find the scp program but i downloaded the winscp and open command prompt to the testing directory.

winscp root@192.168.1.3:/root/Desktop/iptables.txt

then under winscp shell i type this command:

get /root/Desktop/iptables.txt

when i exit from the winscp shell, the file was copied already to the testing directory.

Thanks, ;)

michaelk 09-02-2011 05:02 AM

FYI you can download a windows version of scp called pscp.
http://www.chiark.greenend.org.uk/~s.../download.html

JJJCR 09-05-2011 02:16 AM

Thanks michaelk :)


All times are GMT -5. The time now is 05:49 PM.