Deny local socket/port binding on server.

Deny local socket/port binding on server.

Post by QuestionGu » Fri, 17 Jan 2003 21:28:41



Hi,

A quick question... I am using Redhat Linux 7.x and 8.x. I need to know
how I can deny users on a server from binding to non-superuser ports
without interfering with legitimate operations/programs they might need
to use? Any solution for FreeBSD would be great as well.

I want to make it so a user can't create a script and use sockets to
bind to a 1024+ port and run IRC or some script to open a local SMTP
gateway or run some other chat service or something without my approval.
Is this simply done with firewalls or is there a specific configuration
or kernel option to make this impossible for users, without specifically
allowing them this access somehow?

This could prevent spending time looking out for this. Please let me
know if there's any URL's specific to this or any specific formula or
solution. I thought I saw something about this before on some sites, but
searching using all the appropriate words and phrases are pulling up a
lot of irrelevant sites. Thank you.

TIA -- Tom

 
 
 

Deny local socket/port binding on server.

Post by Julien Matthie » Sat, 18 Jan 2003 05:50:30


if you block port 1024+
what you meen is that users won't be able to communicate to the lan or
internet

> Hi,

> A quick question... I am using Redhat Linux 7.x and 8.x. I need to know
> how I can deny users on a server from binding to non-superuser ports
> without interfering with legitimate operations/programs they might need
> to use? Any solution for FreeBSD would be great as well.

> I want to make it so a user can't create a script and use sockets to
> bind to a 1024+ port and run IRC or some script to open a local SMTP
> gateway or run some other chat service or something without my approval.
> Is this simply done with firewalls or is there a specific configuration
> or kernel option to make this impossible for users, without specifically
> allowing them this access somehow?

> This could prevent spending time looking out for this. Please let me
> know if there's any URL's specific to this or any specific formula or
> solution. I thought I saw something about this before on some sites, but
> searching using all the appropriate words and phrases are pulling up a
> lot of irrelevant sites. Thank you.

> TIA -- Tom


 
 
 

Deny local socket/port binding on server.

Post by 2Host.com - Rober » Sat, 18 Jan 2003 18:15:32



> Hi,

> A quick question... I am using Redhat Linux 7.x and 8.x. I need to know
> how I can deny users on a server from binding to non-superuser ports
> without interfering with legitimate operations/programs they might need
> to use? Any solution for FreeBSD would be great as well.

> I want to make it so a user can't create a script and use sockets to
> bind to a 1024+ port and run IRC or some script to open a local SMTP
> gateway or run some other chat service or something without my approval.
> Is this simply done with firewalls or is there a specific configuration
> or kernel option to make this impossible for users, without specifically
> allowing them this access somehow?

> This could prevent spending time looking out for this. Please let me
> know if there's any URL's specific to this or any specific formula or
> solution. I thought I saw something about this before on some sites, but
> searching using all the appropriate words and phrases are pulling up a
> lot of irrelevant sites. Thank you.

You should have iptables compiled into the kernel since you're using RH
7/8.x. Type: "iptables -m owner --help" and look at --uid-owner,
--gid-owner, etc. That should get you started with firewall rules and
denying source/destination ports for specific users, or any user/group
that's not specifically allowed with whatever port range you want. If
you want someone else and this isn't the solution you were looking for,
feel free to post again.
--
Regards,

Server admin, support & programing for shared & dedicated web servers
Secure, reliable hosting you expect and deserve! http://www.2host.com
 
 
 

Deny local socket/port binding on server.

Post by 2Host.com - Rober » Sat, 18 Jan 2003 18:16:56




> > Hi,

> > A quick question... I am using Redhat Linux 7.x and 8.x. I need to know
> > how I can deny users on a server from binding to non-superuser ports
> > without interfering with legitimate operations/programs they might need
> > to use? Any solution for FreeBSD would be great as well.

> > I want to make it so a user can't create a script and use sockets to
> > bind to a 1024+ port and run IRC or some script to open a local SMTP
> > gateway or run some other chat service or something without my approval.
> > Is this simply done with firewalls or is there a specific configuration
> > or kernel option to make this impossible for users, without specifically
> > allowing them this access somehow?

> > This could prevent spending time looking out for this. Please let me
> > know if there's any URL's specific to this or any specific formula or
> > solution. I thought I saw something about this before on some sites, but
> > searching using all the appropriate words and phrases are pulling up a
> > lot of irrelevant sites. Thank you.

> You should have iptables compiled into the kernel since you're using RH
> 7/8.x. Type: "iptables -m owner --help" and look at --uid-owner,
> --gid-owner, etc. That should get you started with firewall rules and
> denying source/destination ports for specific users, or any user/group
> that's not specifically allowed with whatever port range you want. If
> you want someone else and this isn't the solution you were looking for,

           ^^^^^^^^^^^^

Something else.
--
Regards,

Server admin, support & programing for shared & dedicated web servers
Secure, reliable hosting you expect and deserve! http://www.2host.com

 
 
 

1. Sockets: server close leaves socket bound?

I have a server listening on a bound socket.  I accept a connection.
No matter what I do at this point, if the server closes the connection
before the client it leaves the socket in a messy state and I have to wait
for the system to clean it up before another process can bind to that socket
again.

Is there something that I should be doing aside from close(fd) ?

Pat

2. jumpstart strangeness

3. lbxproxy : Binding Unix socket: Permission denied

4. Q: EAGAIN and Send buffer managing...

5. X: Binding Unix socket: permission denied

6. NIS+: permission denied to passwd

7. All local sockets give permission denied!

8. Gnome 1.0 Window Maker and SuSE 6.0

9. can't bind to port: 80 Permission denied

10. Binding >1 TCP socket to the same local address

11. tftpd on rh8: cannot bind to local socket

12. strange behavior when the client bind its UDP socket to a local address

13. sshd: Denied connection to local port