Skip to main content
Share Your Experience: Take the 2024 Developer Survey
57 votes

Allow non-root process to bind to port 80 and 443?

I have a rather different approach. I wanted to use port 80 for a node.js server. I was unable to do it since Node.js was installed for a non-sudo user. I tried to use symlinks, but it didn't work for ...
noob's user avatar
  • 1,325
42 votes

Allow non-root process to bind to port 80 and 443?

Simplest solution : remove all privileged ports on linux Works on ubuntu/debian : #save configuration permanently echo 'net.ipv4.ip_unprivileged_port_start=0' > /etc/sysctl.d/50-unprivileged-...
soleuu's user avatar
  • 529
36 votes
Accepted

What is the difference and relationship between a process id and a port number?

To answer the question directly: there is no connection between the process ID and the port number. They enumerate entirely different things. The PID identifies a process (eg a Firefox session: each ...
Andrew Leach's user avatar
35 votes
Accepted

how to view haproxy status on the command line using a socket

I found the following to be useful watch 'echo "show stat" | nc -U /var/lib/haproxy/stats | cut -d "," -f 1,2,5-11,18,24,27,30,36,50,37,56,57,62 | column -s, -t' It will produce output as follows ...
nelaaro's user avatar
  • 13.7k
22 votes
Accepted

What is non-networked Unix domain socket?

It's a socket whose address is a filesystem path rather than some form of network address. For example, instead of connecting to an IP address:port such as 127.0.0.1:4567, the program will "...
grawity_u1686's user avatar
20 votes
Accepted

How to expose Linux socket file from Docker container (MySQL, MariaDB, etc.) to host

The problem is that bind mounts are for exposing something on the host to the container. So when you do this: volumes: - /srv/docker/sockets/mariadb.container.sock:/var/run/mysqld/mysqld.sock You ...
larsks's user avatar
  • 4,284
20 votes
Accepted

Is it possible to interchange these two sockets since the cables in the wall look the same?

You can't just 'switch sockets' at one end & hope it will work. Though it looks like they're made up with the same cable - which is a good thing - you don't know where the other end of the phone ...
Tetsujin's user avatar
  • 49.8k
15 votes

Manually closing a port from commandline

You can close a listening socket using ss: sudo ss --kill state listening src :1234 Where 1234 is your port number. ss is part of the iproute2 package, so there is a strong change it is already ...
Tom Anderson's user avatar
  • 1,773
13 votes

Can I monitor a local unix domain socket like tcpdump?

// backup the socket sudo mv /var/run/docker.sock /var/run/docker.sock.original // use tcp port 8089 proxy the original socket sudo socat TCP-LISTEN:8089,reuseaddr,fork UNIX-CONNECT:/var/run/docker....
任喜军's user avatar
  • 141
12 votes

What is the difference and relationship between a process id and a port number?

The PID is shown only so that you can identify the specific process doing the communication and is unrelated to the port number. If you had multiple copies of one program running and they were all ...
Mokubai's user avatar
  • 93.1k
11 votes
Accepted

Connect a M.2 (B & M) key SSD into a B socket

It should... a B&M module should work with either a B or M socket, this is by design. The B interface provides x2 PCIe, SATA, USB 2.0 and 3.0, audio, UIM, HSIC, SSIC, I2C, and SMBus support. ...
acejavelin's user avatar
  • 6,538
10 votes

What is the difference and relationship between a process id and a port number?

Process What is a process? A process is basically a copy of a program. So, if you run a program like Notepad multiple times, each specific time will get its own Process. A process uses resources, ...
TOOGAM's user avatar
  • 16k
10 votes
Accepted

How does HTTP Keepalive handle multiple requests along with EOF from same origin?

When we don't use keep alive, the client's OS sends EOF flag (end of file) to indicate the server that the a file has been completed transmitted No, it doesn't. The end of an HTTP request is detected ...
grawity_u1686's user avatar
6 votes

Where to put Unix sockets?

They are to be stored in /run/ according to the Filesystem Hierarchy Standard (FHS). System programs that maintain transient UNIX-domain sockets must place them in this directory or an appropriate ...
Fred's user avatar
  • 163
6 votes

How to determine the socket connection up time on Linux

This questions was helpful to me, but I found using lsof instead of netstat let me avoid all the HEX stuff: For a process ${APP} run by user ${USER}, the following returns all the open sockets to the ...
Raúl Cuza's user avatar
6 votes

Determining what process has bound a port (without listening) on Windows

I had to do this exact thing today. Powershell can do it with Get-NetTCPConnection. PS C:\WINDOWS\system32> Get-NetTCPConnection -LocalPort 53100 LocalAddress LocalPort ...
Zan Lynx's user avatar
  • 2,178
5 votes
Accepted

What is this socket/port/connector on my laptop?

That is a Kensington lock used for anti-theft purposes. It is attached by means of a cable from something stationary, such as a table, to the device. The cable will then lock at one end from the port, ...
Andrew Li's user avatar
  • 361
5 votes
Accepted

Close open sockets from crashed program

Sockets are finally closed by the Unix kernel; a crashed program is no different from a normal program exit w/o a close()/shutdown() call. Your problem may have to do with the TIME_WAIT state of the ...
nik's user avatar
  • 56.4k
5 votes
Accepted

Why UNIX socket files end with and equal sign in ls?

In your shell, type alias You will get a list of alliasses that you have. In your case, there is probably a line alias l=`ls -F` among them. In man ls you will see that -F, --classify ...
Ljm Dullaart's user avatar
  • 2,537
5 votes

How does HTTP Keepalive handle multiple requests along with EOF from same origin?

The Connection: keep-alive header is implicit with HTTP/1.1, i.e. only needed with HTTP/1.0. And in persistent HTTP/1 one request is send after the other and the responses come back in the same order. ...
Steffen Ullrich's user avatar
4 votes

Is it bad practice to listen on 0.0.0.0? Why?

Tradeoffs between (1) good support for dynamic network configuration, (2) security and firewall rule stability and (3) code complexity (e.g. when network configuration event handling is needed) have ...
Andrej Podzimek's user avatar
4 votes

Allow non-root process to bind to port 80 and 443?

If you are running systemd and linux, then you can simply add to the server unit file: # /etc/systemd/system/http_server.service # ... [Service] # ... AmbientCapabilities = CAP_NET_BIND_SERVICE And, ...
thx1111's user avatar
  • 41
4 votes

Determining what process has bound a port (without listening) on Windows

In recent versions of netstat there is now a command line parameter -q that shows those sockets. $ netstat -? Displays protocol statistics and current TCP/IP network connections. NETSTAT [-a] [-b] [...
zentrunix's user avatar
  • 372
4 votes

pfctl divert-socket in mac os?

Here are docs stating that the divert-packet option really exist: the docs you're citing are written for OpenBSD. Meanwhile Pf was originally written for OpenBSD indeed and Apple had it ported for ...
poige's user avatar
  • 419
4 votes

How can I know what is preventing my socket to bind to localhost:50060-50959

If you face this issue on Win10 2004 that's because of an issue in this update, do the following: netsh int ipv[46] set dynamic tcp start=49152 num=16384 reg add HKLM\SYSTEM\CurrentControlSet\...
realsarm's user avatar
  • 141
4 votes

What is non-networked Unix domain socket?

Based on the context it means that docker is not accessible from outside the host (i.e. local and external network), but "only processes [on the same machine] with root permission or Docker ...
Steffen Ullrich's user avatar
3 votes
Accepted

Only one usage of each socket is normally permitted

It's not an absolute rule on all UNIX systems. Some have extensions that allow multiple processes to bind to the same address and port combination, and the kernel will then handle distributing ...
Austin Hemmelgarn's user avatar
3 votes

Is i7-940XM compatible with rPGA989 socket?

This is a bad idea. Whether it would fit or not, your laptop was very carefully designed around the P6200 processor, which uses at most, 35 watts. The CPU you want to change to is a 55 watt ...
K7AAY's user avatar
  • 9,673
3 votes

Is i7-940XM compatible with rPGA989 socket?

Is the Intel i7-940XM compatible with a rPGA989 socket? The Intel i7-940XM is a PGA989 processor. This processor uses a pin grid array, which means, the processor is soldered to the motherboard. ...
Ramhound's user avatar
  • 42.9k

Only top scored, non community-wiki answers of a minimum length are eligible