LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 03-03-2015, 06:52 AM   #1
Paul!
LQ Newbie
 
Registered: Feb 2014
Posts: 21

Rep: Reputation: Disabled
ssh tunnel


Essentially I want to set up a VPN. There is a lot of information online, which tends to get vague when I need hard details.

So, this is what I want to do.

On my remote computer I want to tunnel to my server, which then transfers to the internet - I'm only interested in http traffic here. In other words, on my browser, on the remote machine, if I attempt to connect to linuxquestions.org, this will be transferred to my server which will transfer the information. In the same way as a 'proper' VPN, the request will appear to have come from the server. I think many of the examples out there are of secure connections to the server itself, and not onwards to the net. I don't just want to connect to a single site - another common example out there, but to have total freedom.

One complication, I would prefer to connect to port 3128, rather than port 80, in order to use the squid cache.

Some articles suggest local tunneling and others dynamic.

Cheers
Paul
 
Old 03-03-2015, 06:53 AM   #2
Paul!
LQ Newbie
 
Registered: Feb 2014
Posts: 21

Original Poster
Rep: Reputation: Disabled
Sorry I'd better add that ssh is up and working.
 
Old 03-03-2015, 07:40 AM   #3
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,636
Blog Entries: 4

Rep: Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933
(Shrug ...) What I'd do, instead, is to just "set up a VPN."

Yes, you can tunnel using ssh. But then, you always have to "think about it." Always have to make sure that what you're sending is really going through that tunnel. Always have to be sure that your apps know how to do it, and that they do "do it" properly.

With VPN, you have none of these concerns: certain ranges of IP-addresses and port-numbers go through the tunnel, automagically. You can forget that the tunnel is there.

Last edited by sundialsvcs; 03-03-2015 at 07:41 AM.
 
Old 03-03-2015, 08:35 AM   #4
agentbuzz
Member
 
Registered: Oct 2010
Location: Texas
Distribution: Debian, Ubuntu, CentOS, RHEL
Posts: 131

Rep: Reputation: 25
SSH tunnel to your server

Paul,
The command to tunnel browser traffic to your server is this:

Code:
[user ~]$ ssh -D 8080 yourusername@server.atyourhome.com
Then you have to go into your browser's proxy settings. In Firefox, you'd bullet "Manual proxy configuration", for "SOCKS Host", you'd type "localhost", port 8080, and bullet SOCKS v5. You can send your DNS queries through the tunnel, as well, by using the instruction in this article. She also has instructions in that article for tunneling to a squid.
 
1 members found this post helpful.
Old 03-03-2015, 10:11 AM   #5
Paul!
LQ Newbie
 
Registered: Feb 2014
Posts: 21

Original Poster
Rep: Reputation: Disabled
Thanks for that, is there anything I need to do at the server end? Other than the normal ssh stuff?
 
Old 03-03-2015, 10:26 AM   #6
Paul!
LQ Newbie
 
Registered: Feb 2014
Posts: 21

Original Poster
Rep: Reputation: Disabled
That's a really useful site, and I hadn't seen it before. Thanks very much - now to find out what all those switches do to ssh!
 
Old 03-03-2015, 10:38 AM   #7
agentbuzz
Member
 
Registered: Oct 2010
Location: Texas
Distribution: Debian, Ubuntu, CentOS, RHEL
Posts: 131

Rep: Reputation: 25
Don't know what your normal ssh stuff is, but consider doing this:

Code:
vi /etc/ssh/sshd_config
Find this section and ensure that PermitRootLogin is set to no:

Code:
#LoginGraceTime 2m
PermitRootLogin no
StrictModes yes
MaxAuthTries 3
#MaxSessions 10
AllowUsers user1 user2
Then, either...
Code:
/etc/init.d/sshd restart
Code:
service sshd restart
 
  


Reply


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
SSH Reverse Tunnel - ~/.ssh/config - PHP marcelp1 Linux - Newbie 1 05-28-2014 12:49 AM
Initiate ssh tunnel to connect to ssh? brianmcgee Linux - Security 2 09-07-2011 10:07 AM
setting up an ssh soxy or local ssh tunnel from within an ssh soxy Mangenius Linux - Networking 0 03-05-2007 03:15 PM
SSH tunnel? tarballedtux Linux - Networking 3 04-09-2002 03:52 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

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