LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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, 09:09 PM   #1
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 2,153

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

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

Original Poster
Rep: Reputation: 449Reputation: 449Reputation: 449Reputation: 449Reputation: 449
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 10:13 PM.
 
Old 09-01-2011, 11:34 PM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,360

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
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, 03:16 AM   #5
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 2,153

Original Poster
Rep: Reputation: 449Reputation: 449Reputation: 449Reputation: 449Reputation: 449
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, 05:02 AM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,721

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

Original Poster
Rep: Reputation: 449Reputation: 449Reputation: 449Reputation: 449Reputation: 449
Thanks michaelk
 
  


Reply



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 07: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 07:45 PM
Using scp to copy files between servers. muskiediver Linux - General 1 07-11-2006 03:52 PM
copy files....using scp help me suguname Mandriva 2 01-26-2005 01:14 AM
copy files....using scp help me suguname Mandriva 5 01-25-2005 05:42 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:10 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
Open Source Consulting | Domain Registration