LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 07-13-2014, 04:16 PM   #1
JamesGT
Member
 
Registered: Oct 2009
Location: St. Louis, MO, USA
Distribution: Slackware64 Live
Posts: 315

Rep: Reputation: 52
IPTables, allow ssh tunneling?


I have a server out on the internet with Slackware 14.1. I set up the ssh security as per this URL:

http://docs.slackware.com/howtos:security:ssh

I'd like to modify the part about ssh_hide so it will allow ssh tunneling on a specific port, how would I do that?

When I disable the ssh_hide script, I can easily do tunneling on the port I would like, but when in use, I can not. What do I need to modify to allow ssh tunneling on a specific port?
 
Old 07-13-2014, 06:16 PM   #2
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,858

Rep: Reputation: 980Reputation: 980Reputation: 980Reputation: 980Reputation: 980Reputation: 980Reputation: 980Reputation: 980
You can't access the server to ports 99,88 or 8889 ?
 
Old 07-13-2014, 07:19 PM   #3
JamesGT
Member
 
Registered: Oct 2009
Location: St. Louis, MO, USA
Distribution: Slackware64 Live
Posts: 315

Original Poster
Rep: Reputation: 52
Quote:
Originally Posted by keefaz View Post
You can't access the server to ports 99,88 or 8889 ?
I can, but I can't use tunneling, it denies access.
 
Old 07-13-2014, 08:08 PM   #4
ReaperX7
LQ Guru
 
Registered: Jul 2011
Location: California
Distribution: Slackware64-15.0 Multilib
Posts: 6,584
Blog Entries: 15

Rep: Reputation: 2140Reputation: 2140Reputation: 2140Reputation: 2140Reputation: 2140Reputation: 2140Reputation: 2140Reputation: 2140Reputation: 2140Reputation: 2140Reputation: 2140
Check sshd_config for the tunneling option, you may have to enable it there and then restart the service.
 
Old 07-13-2014, 09:48 PM   #5
JamesGT
Member
 
Registered: Oct 2009
Location: St. Louis, MO, USA
Distribution: Slackware64 Live
Posts: 315

Original Poster
Rep: Reputation: 52
Quote:
Originally Posted by ReaperX7 View Post
Check sshd_config for the tunneling option, you may have to enable it there and then restart the service.
If I remove the ssh_hide file, and remove the reference from rc.local, it works as it should. If I re-enable that file and code, tunneling stops. I can still connect via ssh, but I can't tunnel, it doesn't allow me to connect at all. It is denied.
 
Old 07-14-2014, 04:00 AM   #6
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,858

Rep: Reputation: 980Reputation: 980Reputation: 980Reputation: 980Reputation: 980Reputation: 980Reputation: 980Reputation: 980
Could you post an example of the ssh command you use for tunnelling ?
 
Old 07-14-2014, 08:24 AM   #7
JamesGT
Member
 
Registered: Oct 2009
Location: St. Louis, MO, USA
Distribution: Slackware64 Live
Posts: 315

Original Poster
Rep: Reputation: 52
Quote:
Originally Posted by keefaz View Post
Could you post an example of the ssh command you use for tunnelling ?
ssh -D 1080 username@123.456.789.012
 
Old 07-14-2014, 12:54 PM   #8
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,858

Rep: Reputation: 980Reputation: 980Reputation: 980Reputation: 980Reputation: 980Reputation: 980Reputation: 980Reputation: 980
did you try adding the destination port eg:
ssh -D 1080 username@123.456.789.012:8889
 
Old 07-14-2014, 03:12 PM   #9
JamesGT
Member
 
Registered: Oct 2009
Location: St. Louis, MO, USA
Distribution: Slackware64 Live
Posts: 315

Original Poster
Rep: Reputation: 52
Quote:
Originally Posted by keefaz View Post
did you try adding the destination port eg:
ssh -D 1080 username@123.456.789.012:8889
When I try that, I get...

"ssh: Could not resolve hostname 123.456.789.012:1080: Name or service not known"

If I try it without the :1080 I get...

"ssh: connect to host 123.456.789.012 port 22: Connection refused"

If I use "ssh -p 1080 username@123.456.789.012", I connect.

Last edited by JamesGT; 07-14-2014 at 03:27 PM.
 
Old 07-14-2014, 04:38 PM   #10
michaelk
Moderator
 
Registered: Aug 2002
Posts: 26,926

Rep: Reputation: 6376Reputation: 6376Reputation: 6376Reputation: 6376Reputation: 6376Reputation: 6376Reputation: 6376Reputation: 6376Reputation: 6376Reputation: 6376Reputation: 6376
Quote:
ssh -D 1080 username@123.456.789.012:8889
Wrong syntax. If you use a port other then 22 (default) then you need to use the -p switch (or set the value in ~/.ssh/config file)

The firewall rules in the posted how-to basically forwards ssh traffic from port 8889 to 22 so you need to use the syntax

ssh -p 8889 username@xxx.xxx.xxx.xxx

Since 1080 works did you modify the script to use 1080 instead of 8889? If you want to use dynamic tunnelling then:

ssh -D xxxx -p 8889 username@xxx.xxx.xxx.xxx
 
1 members found this post helpful.
Old 07-14-2014, 06:51 PM   #11
JamesGT
Member
 
Registered: Oct 2009
Location: St. Louis, MO, USA
Distribution: Slackware64 Live
Posts: 315

Original Poster
Rep: Reputation: 52
Quote:
Originally Posted by michaelk View Post

ssh -D xxxx -p 8889 username@xxx.xxx.xxx.xxx
Worked as it should! Sweet! Thank you very much!

James
 
  


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
iptables and tunneling journal Linux - Networking 1 12-01-2013 10:17 PM
SSH server and SSH tunneling Achical Linux - Security 5 05-20-2012 10:07 AM
[SOLVED] how to configure iptables to allow ssh tunneling? wyattisimo Linux - Security 4 05-02-2011 05:21 PM
libipq, iptables, tunneling Connor.Poske Linux - Networking 0 07-01-2008 01:24 PM
Tunneling with ssh ssherman Linux - Networking 3 07-16-2007 02:13 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

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