nixCraft Linux Forum

nixCraft

Linux Tech Support Forum

Restricting Port forwarding in SSH server

This is a discussion on Restricting Port forwarding in SSH server within the Networking, Firewalls and Security forums, part of the Mastering Servers category; People, Hope you all know about SSH port forwarding. I have been wondering about how can we restrict SSH port ...


Go Back   nixCraft Linux Forum > Mastering Servers > Networking, Firewalls and Security

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 06-12-2007, 05:38 PM
Member
User
 
Join Date: Jul 2005
Posts: 85
Rep Power: 0
ricc
Default Restricting Port forwarding in SSH server

People,

Hope you all know about SSH port forwarding.

I have been wondering about how can we restrict SSH port forwarding.

I have seen a gateway-login server which allows forwarding to a particular host/port only. What I mean by this is that this particular ssh-server allows port forwarding to an IMAP port on an email server in the internal network.

Ppl who want to check their emails just login to the gateway and they can set their IMAP server address as localhost:24443 which gets redirected to thatserver:443

This is a bit odd as we can do forwarding to only the email-server/IMAP port and nothing else.

When I try to do a port forward to some other machine / other port, it just doesn't happen.

#man sshd_config doesn't have any information about restricting portforwardings.

Any clue?

ricc
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 06-12-2007, 08:13 PM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
My distro: Any distro with shell
Posts: 962
Rep Power: 10
nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute
Default

Some commercial server implementations do have options like
AllowForwardingPort number
DenyForwardingPort number
AllowForwardingTo 3000
DenyForwardingTo 8080

However latest version of OpenSSH comes with permitopen="hostort"
It will limit local ssh –L port forwarding such that it may only connect to the specified host and port.

For example, if you want to allow port forwarding to a remote imap server called "server.nixcraft.in", add permitopen="server.nixcraft.in:143". See man page for example.
__________________
Vivek | My personal blog
Linux Evangelist
Play hard stay cool
Reply With Quote
  #3 (permalink)  
Old 08-07-2008, 08:14 PM
Junior Member
User
 
Join Date: Aug 2008
My distro: Ubuntu and FedCore
Posts: 1
Rep Power: 0
jimsmithkka is on a distinguished road
Default restricting access on remote ports

Hi, is there a way to restrict remote port forwarding ports (-R) for a single user?
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
How to open a port fed111 Web servers 1 03-08-2008 11:26 PM
HELP! Port Monitoring! sunburn Shell scripting 1 02-11-2008 01:46 PM
Port forwarding satimis Networking, Firewalls and Security 0 02-02-2008 07:45 AM
Restricting mail traffic bubloob_13 Linux software 1 01-09-2007 03:32 PM
forwarding requests to another ip using IPTABLES ranjanjajodia Linux software 2 03-17-2005 07:34 PM


All times are GMT +5.5. The time now is 05:32 AM.


Powered by vBulletin® Version 3.7.3 - Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36