Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to start a websocket server, but can't connect to it from other machines. Only when I start the websocket server with root permissions it works. So this seems to be an permission Problem.

Which permissions does my user need to open a socket?

share|improve this question
up vote 5 down vote accepted

Usually, root access is needed to open ports under 1024, which covers most of the well known services such as web (80), ssh (22), ftp (21) etc.

Some daemons can be configured to listen on other ports above port 1024 which might let you use them with non-root permissions, but it varies on a product by product basis.

There are other work arounds as well, such as using CAP_NET_BIND_SERVICE, this is described in more detail in this answer, of which the summary is,

The short answer is that you do:

setcap 'cap_net_bind_service=+ep' /path/to/program

And then anytime program is executed thereafter it will have the CAP_NET_BIND_SERVICE capability. setcap is in the debian package libcap2-bin.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.