Visit Our UNIX and Linux User Community


Copying a file from one server to another (behind firewall.)


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Copying a file from one server to another (behind firewall.)
# 1  
Old 08-23-2010
Copying a file from one server to another (behind firewall.)

Hi,

I want to copy a file from one server A to another server B. Usually I use
Code:
scp username@source-server:/path . (from the destination folder)

However, in this particular case, I have server C behind a firewall. So, I connect to Server B and ssh over to server C.

--this is the source server--
cleveland</home/jdoe><jdoe>#

--this is the "hop over" server--
[jdoe@ford:/home/user]> pwd
/home/jdoe

--this is where I want the file--
Code:
[jdoe@ford:/home/jdoe]> ssh xtra400
jdoe@xtra400's password: 
Last login: Mon Aug  9 11:47:26 2010 on /dev/pts/0 from 17.78.200.21
*******************************************************************************
*                                                                             *
*                                                                             *
*  Welcome to AIX Version 5.3!                                                *
*                                                                             *
*                                                                             *
*  Please see the README file in /usr/lpp/bos for information pertinent to    *
*  this release of the AIX Operating System.                                  *
*                                                                             *
*                                                                             *
*******************************************************************************
xtra400():/home/jdoe>


----this is what I tried unsuccessfully----
Code:
[jdoe@ford:/home/jdoe]> scp jdoe@cleveland:/home/jdoe/login.sql .
##############################################################################
# This system is for use by authorized personnel only. Individuals using     #
# this computer system without authority, or in excess of their authority,   #
# are subject to having all of their activities on this system monitored     #
# and recorded by system personnel. In the course of monitoring individuals  #
# improperly using this system, or in the course of system maintenance, the  #
# activities of authorized users may also be monitored. Anyone using this    #
# system expressly consents to such monitoring and is advised that if such   #
# monitoring reveals possible evidence of criminal activity, system          #
# personnel may provide the evidence of such monitoring to            #
# Senior management and HR.                                                  #
##############################################################################

jdoe@cleveland's password: 
login.sql                                                                                                                                      100%  361     0.4KB/s   00:00   
[jdoe@ford:/home/jdoe]> ssh xtra400
jdoe@xtra400's password: 
Last unsuccessful login: Fri Jun 11 14:24:40 2010 on ssh from 17.78.200.21
Last login: Mon Aug 23 10:47:29 2010 on /dev/pts/1 from 17.78.200.21
*******************************************************************************
*                                                                             *
*                                                                             *
*  Welcome to AIX Version 5.3!                                                *
*                                                                             *
*                                                                             *
*  Please see the README file in /usr/lpp/bos for information pertinent to    *
*  this release of the AIX Operating System.                                  *
*                                                                             *
*                                                                             *
*******************************************************************************
xtra400():/home/jdoe> scp jdoe@ford:/home/jdoe/login.sql .
ssh: ford: no address associated with name
xtra400():/home/jdoe> rcp -p jdoe@ford:/home/jdoe/login.sql jdoe@xtra400/home/jdoe/log.sql .
host: name ford NOT FOUND

Can someone tell me how do I do this or what i am doing wrong here? I know this can be done, because I have seen my colleagues copy files from Cleveland to Xtra400. I asked them, and all they say is since XTRA400 is behind a firewall, you ssh over to it from ford, and then copy over the file!

Please help me!

Last edited by vbe; 08-23-2010 at 12:17 PM.. Reason: code tags...
# 2  
Old 08-23-2010
One of these computers does not know who "FORD" is. Try giving it an IP address instead.
# 3  
Old 08-23-2010
Ok, I was told, I can't pull the file from ford (assuming I was logged into XTRA400) because of the firewall.

I must push the file from ford to xtra400 using scp.

Any ideas how do I do that??
# 4  
Old 08-23-2010
Presumably the same way you'd copy from any other machine. We're pretty limited on the details of your network and firewall here.

Really, though: Reading the error messages can be a worthwhile pastime. Your previous attempt failed, not because of a firewall, but because the originating system didn't know who ford was. It never even tried to copy the file, just spun for a while looking for the 'ford' hostname then gave up. If you give it the IP address for ford instead of the name "ford", it might work.
 

Previous Thread | Next Thread
Test Your Knowledge in Computers #714
Difficulty: Medium
Machine learning is a well known method for mitigating the Von Neumann performance bottleneck
True or False?

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to preserve time stamp while copying a directory from Server B to Server A?

Experts, Please help me out here. How to preserve time stamp while copying a directory from Server B to Server A (3 Replies)
Discussion started by: ahmed.vaghar
3 Replies

2. Shell Programming and Scripting

Copying a file with UTF char on UNIX server

Hi, I need to run a SQL which check for special UTF char in DB. When I try to copy that in UNIX file it changes it to some wierd chat. How can in retain the UTF chars in my script? e.g. ο|π|ρ|σ|τ|υ|φ|χ|ψ Any help will be appriciated. Thanks, (14 Replies)
Discussion started by: varun22486
14 Replies

3. Shell Programming and Scripting

Copying the files to Windows server from UNIX server

Hi Team, I had a requirement to write a shell script which automatically transfer the files from unix server to windows server. I can able to unix to unix using Scp command. I am not sure how to do unix to windows. I am very new on this concept. Could you please help me or guide in... (4 Replies)
Discussion started by: gvkumar25
4 Replies

4. Solaris

Copying data from one file server to another

Hello people, I have a question regarding transferring data from one file server to another. The server is a Solaris 9 box The old file server is connected via Ethernet cable, and the new file server we are switching is a Fiber channel. can I use the dd if=server:/app1 of=server2:/app1 ... (2 Replies)
Discussion started by: br1an
2 Replies

5. IP Networking

Named - DNS Server - within Firewall

I spent hours trying to create a system where the name server returns a value of 192.168.100.5 locally, but 209.137.nnn.nnn for requests outside of the firewall. If I run "nslookup mail.mydomain.com" from a machine inside the firewall, the 192.168 number is returned, but if I do "nslookup... (3 Replies)
Discussion started by: jgt
3 Replies

6. AIX

Copying crontab for a user from one server to other server.

Could you please let me know, if the crontab for a user (eg test)in /var/spool/cron/crontabs directory can be copied from one server to other server. Both the servers are on AIX 5.3 and the target servers has the test user and all the executable files listed in the crontab for the test user on the... (1 Reply)
Discussion started by: saikiran_1984
1 Replies

7. UNIX for Dummies Questions & Answers

Copying dir (and sub dir) file names from ftp server to txt file in diff server

Hey all, i want to copy only the file names from an ftp server (directory and all sub directory) to a text file in another server (non ftp), i.e. i want to recursively move through directories and copy only the names to a text file. any help is appreciated...thank you in advance (1 Reply)
Discussion started by: deking
1 Replies

8. UNIX for Dummies Questions & Answers

script copying the directory (or file) from server to my pc

Hello, I'm trying to create the shell script that: copy (or transfer) the directory from the unix server to my external hard drive (or hard drive) I've been serching this kind of thread here, but no luck so far. anyone can help me? Thank you. (2 Replies)
Discussion started by: myjwjw
2 Replies

9. UNIX for Dummies Questions & Answers

copying directories from NT server to Unix server (solaris 5.8)

I need to copy around 30 directories (each directory include one or more text file(s)) from NT server to Unix server at one go. For doing this what are the privillages i should have in both NT and Unix server. Please let me know which command i can use in shell prompt. TIA. (4 Replies)
Discussion started by: jhmr7
4 Replies

10. UNIX for Advanced & Expert Users

Copying a file from Solaris to Windows 2003 server

Hello, I am really new to solaris and I want to know the easiest way to copy a file from a solaris server to an Iomega NAS running windows 2003 server. Can I map the drive on the windows box so the solaris server can see it. Any advice would be appreciated. (1 Reply)
Discussion started by: akula81
1 Replies

Featured Tech Videos