Search This Blog

Wednesday, August 14, 2013

OpenSuse Mono enable binding on low port numbers/ open low ports

1. You need to install "capabilities" library on OpenSuse.
zypper install libcap-progs
zypper install libcap1
zypper install libcap2

2. Allow mono to bind on low ports numbers:

setcap 'cap_net_bind_service=+ep' /usr/bin/mono-boehm

Now you'll be able to run .NET programs that bind on port numbers (below 1024) that are traditionally reserved for root (require root privileges). Traditional UNIX implementations distinguish two categories of processes: privileged processes (whose effective user ID is 0, referred to as superuser or root), and unprivileged processes (whose effective UID is nonzero). Privileged processes bypass all kernel permission checks. In order to run a process as non-root and bind to a port <1024 you need to give that binary a net_bind_service capability.

1 comment:

  1. Hi, Great.. Tutorial is just awesome..It is really helpful for a newbie like me.. I am a regular follower of your blog. Really very informative post you shared here. Kindly keep blogging. If anyone wants to become a .Net developer learn from Dot Net Training in Chennai. or learn thru Dot Net Training in Chennai. Nowadays Dot Net has tons of job opportunities on various vertical industry.
    or Javascript Training in Chennai. Nowadays JavaScript has tons of job opportunities on various vertical industry.

    ReplyDelete

If you like this post, please leave a comment :)