LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-27-2007, 03:11 PM   #1
meawoppl
LQ Newbie
 
Registered: Jun 2006
Posts: 5

Rep: Reputation: 0
Using scp with ssh tunnel


Heres the problem:
I have set up a ssh server at my home that listens on the required port. From there, I can ssh into the other Linux machines on the network. This works fine, but I can not figure out how to copy files from my laptop at a coffee shop to one of the Linux machines behind the ssh server.

I have been using scp to move the files I wanted to move on to the ssh server, and then ssh'ing into the server and using the same to copy to the machine on the network.

This is a pain. Is there a way to simply accomplish this? Heck, is there even a difficult way to accomplish this?

Basically I want scp to tunnel through servers to get my data somewhere . . . Any help would be appreciated.

Thanks!
 
Old 01-27-2007, 03:36 PM   #2
pnellesen
Member
 
Registered: Oct 2004
Location: Missouri, USA
Distribution: Slackware 12.2, Xubuntu 9.10
Posts: 371

Rep: Reputation: 31
I could be wrong about this (I haven't tried it) but I would think that, once you're connected to your home server via SSH in one terminal, you would be able to open another terminal and then use scp to copy directly from the laptop to the server: "scp /laptopDirectory/fileOnLaptop user@yourserver /serverDirectory/fileOnServer" or something similar... (check "man scp" for details )
 
Old 01-27-2007, 03:37 PM   #3
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
well you wouldn't use ssh *and* scp together, as they are the same thing inside....

ok. start again....

you use ssh to get into your lan and then want to copy files across that conenction and directly into another machine in your private network? ok that's fine... as part of your ssh connection, add a tunnel, e.g. -L 1234thermachinesip:22 and log in. then you can launch scp to connect to 127.0.0.1:1234. connecting to that will actually connect to othermachinesip:22 i.e. ssh/scp/sftp on the "unreachable" machine. that what you mean?
 
Old 01-27-2007, 04:04 PM   #4
meawoppl
LQ Newbie
 
Registered: Jun 2006
Posts: 5

Original Poster
Rep: Reputation: 0
Thanks!

That is a great solution. I was confused at first about the syntax, but basically the -L switch will reroute after the first connection to the next sub-connection and redirect everything just right. Thanks!
 
  


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
SSH tunnel help ZST Linux - Networking 2 07-05-2006 01:35 PM
ssh tunnel crep Linux - Networking 2 08-25-2004 08:24 PM
ssh tunnel TroelsSmit Linux - Software 2 04-30-2004 03:30 PM
Ssh Tunnel tinaa Linux - Software 7 07-29-2003 07:52 PM
SSH tunnel? tarballedtux Linux - Networking 3 04-09-2002 03:52 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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

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