LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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-05-2011, 06:25 AM   #1
githin
LQ Newbie
 
Registered: May 2011
Posts: 3

Rep: Reputation: 0
Copying files with scp - from a network to another network


I have a debian box, a.ces.school.edu, in my lab and my laptop also runs debian (on another DHCP lan home network outside school). I can access my lab's debian computer from outside school only by first ssh-ing to a server setup by the school - access.ces.school.edu, and then, from the server ssh-ing to my lab computer. That works fine and I can view all my files on my lab computer from home.

But, I would like to copy some files from my lab computer to my home computer. With scp, I know how to do that if I could connect directly with my school computer. In the present scenario, I can't figure out how to copy files.

Does anyone know how this can be done?

Thanks
 
Old 05-05-2011, 06:51 AM   #2
pingu
Senior Member
 
Registered: Jul 2004
Location: Skuttunge SWEDEN
Distribution: Debian preferably
Posts: 1,350

Rep: Reputation: 127Reputation: 127
If both lab & laptop are on a private network, which I believe is the case, there are 2 ways to accomplish this.
1) From laptop, ssh in to schools server, which has a public ip.
Then scp from lab to server, followed by scp from laptop to server.
2) If your laptop is behind a decent router, setup portforwarding on router so port 22 is forwarded to laptop.
Then scp from lab to your routers public ip.
 
Old 05-05-2011, 07:00 AM   #3
NightHorse
Member
 
Registered: Jun 2009
Location: Egypt
Distribution: Ubuntu 10.04
Posts: 117

Rep: Reputation: 16
Hi githin,

You can copy the files to access.ces.school.edu and then transfer them to the other host.

Or you can ssh to access.ces.school.edu and from there scp user@lab:~/src user@home:~/dst
but to do that you need to setup a pub_key private_key authentication between your host at home and your Debian box. To do that:
1. At home box:
$ ssh-keygen -t dsa
2. At gateway access.ces.school.edu
$ scp user@home:~/.ssh/id_dsa.pub ~/
$ scp ~/id_dsa.pub user@a.ces.school.edu:~/
3. At a.ces.school.edu
$ cat ~/id_dsa.pub >> ~/.ssh/authorized_keys
$ chmod 700 ~/.ssh/authorized_keys
$ chmod 755 ~/.ssh

You might need to transfer the signature of both hosts on each other, I am not sure about this step cause I don't have same setup to try. but you got the idea.

If the above steps where successful you can from you lab just do ssh access.ces.school.edu 'scp user@lab:~/src user@home:~/dst'

Again I don't have the setup to try that, so If It's successful with you please let me know.
 
Old 05-05-2011, 07:06 AM   #4
githin
LQ Newbie
 
Registered: May 2011
Posts: 3

Original Poster
Rep: Reputation: 0
Additional problem

FOrgot to add this point - The access.ces.school.edu has limited storage space. Its run by the school. I can try to forward the port on the router.
 
Old 05-05-2011, 08:57 PM   #5
githin
LQ Newbie
 
Registered: May 2011
Posts: 3

Original Poster
Rep: Reputation: 0
Thanks for all the suggestions. It seems my school has a provision to allow direct ssh to my lab computer from outside the campus. If they do it for me, I can use the simple scp command to copy. If not, I will experiment with these methods.

BTW, I cleared up some space on the access machine and tried copying. That works fine, only that it is a two step process. Thanks once again.
 
  


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
Copying files over a network - Strange behaviour jsteel Linux - Networking 5 01-11-2010 01:32 PM
Copying Large Files on the Network bichonfrise74 Linux - Newbie 7 02-20-2009 12:48 PM
high IOWait on server when copying files from network InDubio Linux - Networking 2 03-12-2007 03:10 AM
Copying files through a network. Denwar Mandriva 1 04-13-2004 07:30 AM
copying files across the network jcwilliams Linux - Networking 2 01-12-2001 12:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 11:57 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