LinuxQuestions.org
Help answer threads with 0 replies.
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 09-01-2011, 10:09 PM   #1
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 1,104

Rep: Reputation: 181Reputation: 181
Smile 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.
 
Old 09-01-2011, 10:29 PM   #2
andrewthomas
Senior Member
 
Registered: May 2010
Location: Chicago Metro
Distribution: Arch, Gentoo, Slackware
Posts: 1,690

Rep: Reputation: 308Reputation: 308Reputation: 308Reputation: 308
Quote:
-r Recursively copy entire directories.
Why are you using -r with a file?
 
Old 09-01-2011, 11:08 PM   #3
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 1,104

Original Poster
Rep: Reputation: 181Reputation: 181
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.

Last edited by JJJCR; 09-01-2011 at 11:13 PM.
 
Old 09-02-2011, 12:34 AM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,241

Rep: Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325
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
 
Old 09-02-2011, 04:16 AM   #5
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 1,104

Original Poster
Rep: Reputation: 181Reputation: 181
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,
 
Old 09-02-2011, 06:02 AM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 14,950

Rep: Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530
FYI you can download a windows version of scp called pscp.
http://www.chiark.greenend.org.uk/~s.../download.html
 
Old 09-05-2011, 03:16 AM   #7
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 1,104

Original Poster
Rep: Reputation: 181Reputation: 181
Thanks michaelk
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
LXer: scp- secure way to copy files between hosts using ssh LXer Syndicated Linux News 0 07-04-2009 08:10 AM
Trying to copy files from a RHL server with puTTY through ssh to my XP box dave247 Linux - Networking 3 05-29-2008 08:45 PM
Using scp to copy files between servers. muskiediver Linux - General 1 07-11-2006 04:52 PM
copy files....using scp help me suguname Mandriva 2 01-26-2005 02:14 AM
copy files....using scp help me suguname Mandriva 5 01-25-2005 06:42 AM


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

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration