How to change access rights for eth1?

Hello all,

how can I change access rights for ethernet network interface eth1?
I am trying with kdevelop to debug an application. But application is not allowed to access to eth1 and listen to incoming tcp requests!

Thanks and regards,
Jens

An ethernet interface is a system resource. Besides there isn’t a filesystem object called eth1 that you can open with filesystem calls. And anyway programs do not normally deal with raw interfaces but use the socket interface, which deals with protocols, addresses and ports.

What is it you are trying to do? There’s probably a way to do it, if you explain yourself.

I am trying to develop a tcp server. When I am run the code as root it works. But with kdevelop as normal user I get an error message “no access…”.

Jens

“No permissions to access port”

You know that on Unix/Linux only root can listen to ports < 1024? And this cannot be changed by configuring something, the process has to be run by root.

Ok - I understand. I have to use a port > 1024. Thanks a lot.
Jens

Just to explain your options for those who see this thread later.

If you are just playing around with socket programming, use a free port >= 1024 and there is no problem running as a normal user. Don’t pick 1024 to start with, it’s probably in use. Pick something random that’s not a well-known port, after all you have nearly 2^16 choices.

If you must use a low port because you are trying to emulate a well-known service, then you can:

  1. Run as root, of course.

  2. Let xinetd do the listening for you.

  3. Use iptables to redirect a low port to a server listening on a high port.

  4. Start off as root (say a setuid program), open the port and then drop root privileges (this is what Apache does).

access rights for eth1?