Ask Your Question

Open low tcp port from ROS node

asked 2013-10-23 17:47:51 -0500

dpkoch gravatar image

updated 2014-01-28 17:18:20 -0500

ngrennan gravatar image

I'm currently writing a node that uses a 3rd party library. This library listens for multi-cast data streaming on port 1001. The problem I'm running into is that it requires root privileges to bind to this port (or any port <= 1023).

There isn't anything I can do to change the port number that I'm aware of, and (a) I don't want to have to run the node as root, especially since this node is likely gong to be distributed, and (b) as far as I can tell running the node as root isn't possible even if I wanted too.

Does anybody know what I might be able to do to listen to port 1001 from within my node?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2013-10-23 20:25:03 -0500

Thomas gravatar image

updated 2013-10-24 15:29:57 -0500

Port under 1024 cannot be open by non-root user on Linux by design. You can play with the uid/gid permissions to allow the node to run with root capabilities while being able to be launched by anyone but this does not solve the safety issue.

I don't know your library but it is unlikely that it binds a low port number without allowing you to change the port number. And if it really is the case, I guess you should send a bug report to them.

edit flag offensive delete link more



The library I'm using is an SDK that has the port number hard-coded (it streams data from software on a remote computer that also has the port hard-coded). I'll work with the SKD developers on finding a more permanent solution, but I was at least able to test my node using the setuid flag. Thanks!

dpkoch gravatar image dpkoch  ( 2013-10-24 09:56:13 -0500 )edit

Great to hear this! Be extra careful with setuid as the process will run as root. Good luck.

Thomas gravatar image Thomas  ( 2013-10-24 15:31:16 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2013-10-23 17:47:51 -0500

Seen: 178 times

Last updated: Oct 24 '13