LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 05-11-2006, 06:38 AM   #1
noir911
Member
 
Registered: Apr 2004
Location: Baltimore, MD
Posts: 681

Rep: Reputation: Disabled
scp between 2 hosts from a 3rd host


I am on host X and from here I want to scp files from host Y and Z.

For example,

me@hostX# scp me@hostY:/home/me/file.txt me@hostZ:

This would save me the hassle of connecting to host Y and then scp the file to host Z.

Is there any special switch in scp I can use to achieve this? Or make any changes to sshd_config file?
 
Old 05-11-2006, 07:25 AM   #2
ioerror
Member
 
Registered: Sep 2005
Location: Old Blighty
Distribution: Slackware, NetBSD
Posts: 536

Rep: Reputation: 30
You don't need any special option, scp can do that anyway.

From the scp man page:

Code:
SYNOPSIS
     scp [-1246BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file]
         [-l limit] [-o ssh_option] [-P port] [-S program]
         [[user@]host1:]file1 [...] [[user@]host2:]file2
 
Old 05-12-2006, 05:39 AM   #3
noir911
Member
 
Registered: Apr 2004
Location: Baltimore, MD
Posts: 681

Original Poster
Rep: Reputation: Disabled
Seems like scp can't do it. Here's an example,

Code:
[user1 @ wired ~]$ scp john@linux1:/home/john/test_file john@test:/home/test/
john@linux1's password: <entered> & then the following comes 3 times
Permission denied, please try again.
Permission denied, please try again.
Permission denied (publickey,password,keyboard-interactive).
lost connection

Last edited by noir911; 05-12-2006 at 05:41 AM.
 
Old 05-12-2006, 05:55 AM   #4
ioerror
Member
 
Registered: Sep 2005
Location: Old Blighty
Distribution: Slackware, NetBSD
Posts: 536

Rep: Reputation: 30
Hmm, according to the man page it should work:
Quote:
Any file name may contain a host and user specification to indicate that
the file is to be copied to/from that host. Copies between two remote
hosts are permitted.
Have you tried it using public keys, so you don't have to enter a password? Either way should work, but it might narrow down the problem.
 
  


Reply

Tags
scp


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
scp: port 22: No route to host xpucto Linux - Networking 4 10-22-2013 09:58 PM
Possible to have a dynamic host entry in hosts file? bbarron Linux - Networking 3 06-28-2006 07:01 PM
Adding a host alias in /etc/hosts tortle Suse/Novell 3 12-05-2005 10:53 AM
HOST name in HOSTS file (127.0.0.1) fipeso Linux - Networking 1 05-05-2005 06:22 AM
Adding a host to /etc/hosts kzazula Linux - Newbie 1 10-25-2003 12:22 AM


All times are GMT -5. The time now is 04:10 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration