Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Thu Sep 17, 2009 3:44 am 
Offline
Junior Member

Joined: Tue May 20, 2008 3:00 am
Posts: 37
Hello,

I'm at school behind an http proxy and I can SSH into a Linux server here at school and access my Linode from there. I can also tunnel through that server to do (almost) anything I want, except SSH directly from my machine or use SFTP. Tunnelling is legal here at school, so I'm not trying to do anything illegal here ;)

But I was wondering how I could easily access my files from my machine in a secure way? And would running a VPN solve anything? Never used anything like it.

Also I've been trying to use tsocks, which isn't really working. I've also read stuff about SSH relaying but I haven't been able to set it up.

Any ideas? Thanks :)


Last edited by Navi on Fri Sep 18, 2009 3:54 am, edited 1 time in total.

Top
   
 Post subject:
PostPosted: Thu Sep 17, 2009 12:08 pm 
Offline
Senior Member
User avatar

Joined: Tue May 26, 2009 3:29 pm
Posts: 1691
Location: Montreal, QC
SFTP works in the SSH connection itself, so I believe you should be able to set up an SSH tunnel of SSH and go through that.

So, connect to the local machine (port 22), and have it listen on port 1234 and forward that to port 22 on the remote box. Then SFTP to the local machine on port 1234.


Top
   
 Post subject:
PostPosted: Fri Sep 18, 2009 2:36 am 
Offline
Junior Member

Joined: Tue May 20, 2008 3:00 am
Posts: 37
Yeah I've setup an SSH tunnel to the server at school, but I can't SFTP nor SSH through it.

I'm trying to go like :

Laptop -> ServerAtSchool -> MyLinode

SSH from Laptop to ServerAtSchool works, also tunnelling. SSH to MyLinode doesn't work (and no SFTP ofcourse). And when I enable my SOCKS proxy system wide, SSH nor my SFTP program won't connect to MyLinode.

I've tried to play around with the -L and -R switches, but I don't understand where to run em from and stuff. Also the ServerAtSchool is running "SSH Secure Shell 3.2.9.1", 'ssh -D' doesn't seem to work on it, so I can't run a tunnel from ServerAtSchool to MyLinode x.x;

I think I've tried what you meant, but not sure. If not, would you mind giving the commands for an example :)?

Thanks!


Top
   
 Post subject:
PostPosted: Fri Sep 18, 2009 3:38 am 
Offline
Senior Member

Joined: Thu Nov 25, 2004 10:05 am
Posts: 52
If I understand your problem correctly, you need to do this from your laptop:

ssh ServerAtSchool -L 2222:linode:22

(replace ServerAtSchool and linode with appropriate hostnames/IPs)

this sets up a local (ie your laptop) port forward to your linode, tunneled via ServerAtSchool. Once logged into ServerAtSchool you should be able to SFTP to localhost:2222 from your laptop, but actually end up at your linode.

to use a different port with command line SFTP, you'll need to:

sftp -oPort=2222 localhost

2222 can be swapped for any high numbered port (>1024 that doesn't have a service running on it on your laptop)

You'll need to keep the ssh to ServerAtASchool session open, which probably isn't a problem, but look at the -N and -f options in the ssh manpage if you don't like this.

If you use this with more than one host, you'll hit problems with ssh thinking localhost has changed keys - just delete the relevant lines from your ~/.ssh/known_hosts file before connecting.

Hope that helps..


Top
   
 Post subject:
PostPosted: Fri Sep 18, 2009 3:54 am 
Offline
Junior Member

Joined: Tue May 20, 2008 3:00 am
Posts: 37
Whoa, yeah. That's exactly what I needed! Thanks a -lot-, it's working like a charm!

Keeping it open isn't a problem indeed, I'm just screening it lol.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group