Where to start First steps track · 15 stages
Linux Labs

Unix sockets — processes talking through a file

cheat sheet · Ubuntu 24.04 · iproute2 6.1 · nginx 1.24 https://lab.dimsanych.ru/en/wiki/unix-sockets/

Cheat sheet

  • ls -l /run/app/app.sock s as the first letter — a socket
  • stat -c '%F %a %U:%G' /run/app/app.sock type, mode, owner
  • ss -xl listening unix sockets
  • sudo ss -xlp | grep app.sock which process listens
  • sudo find /run -type s sockets under /run
  • curl --unix-socket /run/app/app.sock http://localhost/ HTTP over it
  • nc -U /run/app/app.sock a raw connection
  • sudo chgrp www-data /run/app/app.sock access for nginx's group
  • sudo chmod 660 /run/app/app.sock
Loading…