$ cat /etc/hostname
devbox
$ cat /etc/hostname
devbox
$ cat /etc/hostname
devbox
$ cat /etc/hosts
127.0.0.1 localhost
127.0.1.1 devbox
::1 localhost ip6-localhost
$ cat /etc/hosts
127.0.0.1 localhost
127.0.1.1 devbox
::1 localhost ip6-localhost
$ cat /etc/hosts
127.0.0.1 localhost
127.0.1.1 devbox
::1 localhost ip6-localhost
127.0.0.1 api.local
127.0.0.1 api.local
127.0.0.1 api.local
$ cat /etc/resolv.conf
nameserver 127.0.0.53
options edns0 trust-ad
search .
$ cat /etc/resolv.conf
nameserver 127.0.0.53
options edns0 trust-ad
search .
$ cat /etc/resolv.conf
nameserver 127.0.0.53
options edns0 trust-ad
search .
Your app → /etc/resolv.conf → systemd-resolved (127.0.0.53) → Real DNS server
Your app → /etc/resolv.conf → systemd-resolved (127.0.0.53) → Real DNS server
Your app → /etc/resolv.conf → systemd-resolved (127.0.0.53) → Real DNS server
$ cat /etc/nsswitch.conf
hosts: files mdns4_minimal [NOTFOUND=return] dns myhostname
$ cat /etc/nsswitch.conf
hosts: files mdns4_minimal [NOTFOUND=return] dns myhostname
$ cat /etc/nsswitch.conf
hosts: files mdns4_minimal [NOTFOUND=return] dns myhostname
$ cat /proc/net/route
Iface Destination Gateway Flags ... Mask Metric
eth0 00000000 0101A8C0 0003 00000000 100
eth0 0001A8C0 00000000 0001 00FFFFFF 100
$ cat /proc/net/route
Iface Destination Gateway Flags ... Mask Metric
eth0 00000000 0101A8C0 0003 00000000 100
eth0 0001A8C0 00000000 0001 00FFFFFF 100
$ cat /proc/net/route
Iface Destination Gateway Flags ... Mask Metric
eth0 00000000 0101A8C0 0003 00000000 100
eth0 0001A8C0 00000000 0001 00FFFFFF 100
Destination: 0.0.0.0 → Default route (everything not matched)
Gateway: 192.168.1.1 → My router
Destination: 0.0.0.0 → Default route (everything not matched)
Gateway: 192.168.1.1 → My router
Destination: 0.0.0.0 → Default route (everything not matched)
Gateway: 192.168.1.1 → My router
$ ls /proc/$(pgrep node)
cmdline cwd environ exe fd maps net net/ ...
$ ls /proc/$(pgrep node)
cmdline cwd environ exe fd maps net net/ ...
$ ls /proc/$(pgrep node)
cmdline cwd environ exe fd maps net net/ ...
/proc/<pid>/cmdline → The exact command that started the process
/proc/<pid>/environ → ALL environment variables the process can see
/proc/<pid>/cwd → A symlink to the process's current working directory
/proc/<pid>/exe → A symlink to the binary being executed
/proc/<pid>/fd/ → Every file descriptor the process has open
/proc/<pid>/maps → Memory layout: code, stack, heap, shared libraries
/proc/<pid>/net/ → This SPECIFIC process's network view (containers!)
/proc/<pid>/cmdline → The exact command that started the process
/proc/<pid>/environ → ALL environment variables the process can see
/proc/<pid>/cwd → A symlink to the process's current working directory
/proc/<pid>/exe → A symlink to the binary being executed
/proc/<pid>/fd/ → Every file descriptor the process has open
/proc/<pid>/maps → Memory layout: code, stack, heap, shared libraries
/proc/<pid>/net/ → This SPECIFIC process's network view (containers!)
/proc/<pid>/cmdline → The exact command that started the process
/proc/<pid>/environ → ALL environment variables the process can see
/proc/<pid>/cwd → A symlink to the process's current working directory
/proc/<pid>/exe → A symlink to the binary being executed
/proc/<pid>/fd/ → Every file descriptor the process has open
/proc/<pid>/maps → Memory layout: code, stack, heap, shared libraries
/proc/<pid>/net/ → This SPECIFIC process's network view (containers!)
$ cat /proc/$(pgrep node)/environ | tr '\0' '\n' | grep DB
DATABASE_URL=mongodb://localhost:27017/myapp
$ cat /proc/$(pgrep node)/environ | tr '\0' '\n' | grep DB
DATABASE_URL=mongodb://localhost:27017/myapp
$ cat /proc/$(pgrep node)/environ | tr '\0' '\n' | grep DB
DATABASE_URL=mongodb://localhost:27017/myapp
$ cat /etc/passwd
root:x:0:0:root:/root:/bin/bash
pratham:x:1000:1000:Pratham Bhardwaj:/home/pratham:/bin/bash
$ cat /etc/passwd
root:x:0:0:root:/root:/bin/bash
pratham:x:1000:1000:Pratham Bhardwaj:/home/pratham:/bin/bash
$ cat /etc/passwd
root:x:0:0:root:/root:/bin/bash
pratham:x:1000:1000:Pratham Bhardwaj:/home/pratham:/bin/bash
$ cat /etc/shadow
pratham:$6$rounds=5000$salt$hashed_password_here:19478:0:99999:7:::
$ cat /etc/shadow
pratham:$6$rounds=5000$salt$hashed_password_here:19478:0:99999:7:::
$ cat /etc/shadow
pratham:$6$rounds=5000$salt$hashed_password_here:19478:0:99999:7:::
$ ls /etc/systemd/system/
multi-user.target.wants/ nginx.-weight: 500;">service node-app.-weight: 500;">service ... $ cat /etc/systemd/system/nginx.-weight: 500;">service
[Unit]
Description=A high performance web server
After=network.target [Service]
Type=forking
ExecStartPre=/usr/sbin/nginx -t
ExecStart=/usr/sbin/nginx
ExecReload=/bin/kill -s HUP $MAINPID
PrivateTmp=true [Install]
WantedBy=multi-user.target
$ ls /etc/systemd/system/
multi-user.target.wants/ nginx.-weight: 500;">service node-app.-weight: 500;">service ... $ cat /etc/systemd/system/nginx.-weight: 500;">service
[Unit]
Description=A high performance web server
After=network.target [Service]
Type=forking
ExecStartPre=/usr/sbin/nginx -t
ExecStart=/usr/sbin/nginx
ExecReload=/bin/kill -s HUP $MAINPID
PrivateTmp=true [Install]
WantedBy=multi-user.target
$ ls /etc/systemd/system/
multi-user.target.wants/ nginx.-weight: 500;">service node-app.-weight: 500;">service ... $ cat /etc/systemd/system/nginx.-weight: 500;">service
[Unit]
Description=A high performance web server
After=network.target [Service]
Type=forking
ExecStartPre=/usr/sbin/nginx -t
ExecStart=/usr/sbin/nginx
ExecReload=/bin/kill -s HUP $MAINPID
PrivateTmp=true [Install]
WantedBy=multi-user.target
$ ls /var/log/
auth.log kern.log syslog nginx/ -weight: 500;">apt/ ...
$ ls /var/log/
auth.log kern.log syslog nginx/ -weight: 500;">apt/ ...
$ ls /var/log/
auth.log kern.log syslog nginx/ -weight: 500;">apt/ ...
$ tail -f /var/log/auth.log
May 10 16:42:01 devbox sshd[1234]: Failed password for pratham from 45.33.32.156 port 48652 ssh2
May 10 16:42:03 devbox sshd[1234]: Failed password for pratham from 45.33.32.156 port 48654 ssh2
May 10 16:42:05 devbox sshd[1234]: Failed password for pratham from 45.33.32.156 port 48656 ssh2
$ tail -f /var/log/auth.log
May 10 16:42:01 devbox sshd[1234]: Failed password for pratham from 45.33.32.156 port 48652 ssh2
May 10 16:42:03 devbox sshd[1234]: Failed password for pratham from 45.33.32.156 port 48654 ssh2
May 10 16:42:05 devbox sshd[1234]: Failed password for pratham from 45.33.32.156 port 48656 ssh2
$ tail -f /var/log/auth.log
May 10 16:42:01 devbox sshd[1234]: Failed password for pratham from 45.33.32.156 port 48652 ssh2
May 10 16:42:03 devbox sshd[1234]: Failed password for pratham from 45.33.32.156 port 48654 ssh2
May 10 16:42:05 devbox sshd[1234]: Failed password for pratham from 45.33.32.156 port 48656 ssh2
$ grep "Failed password" /var/log/auth.log | wc -l
847
$ grep "Failed password" /var/log/auth.log | wc -l
847
$ grep "Failed password" /var/log/auth.log | wc -l
847
$ cat /proc/net/tcp
sl local_address rem_address st ...
0: 00000000:0016 00000000:00 0A ← Port 22 (SSH) listening
1: 0100007F:0035 00000000:00 0A ← Port 53 (DNS)
2: 00000000:1F40 00000000:00 0A ← Port 8000 (my Node.js)
$ cat /proc/net/tcp
sl local_address rem_address st ...
0: 00000000:0016 00000000:00 0A ← Port 22 (SSH) listening
1: 0100007F:0035 00000000:00 0A ← Port 53 (DNS)
2: 00000000:1F40 00000000:00 0A ← Port 8000 (my Node.js)
$ cat /proc/net/tcp
sl local_address rem_address st ...
0: 00000000:0016 00000000:00 0A ← Port 22 (SSH) listening
1: 0100007F:0035 00000000:00 0A ← Port 53 (DNS)
2: 00000000:1F40 00000000:00 0A ← Port 8000 (my Node.js) - [Unit] — What this -weight: 500;">service is, what it depends on
- [Service] — How to -weight: 500;">start, -weight: 500;">stop, and reload it
- [Install] — When in the boot sequence to -weight: 500;">start it - auth.log — every login attempt (successful and failed), -weight: 600;">sudo usage, SSH activity
- syslog — general system messages, kernel events, -weight: 500;">service starts/stops
- kern.log — kernel-specific messages (hardware, driver events)
- nginx/access.log — every single HTTP request to the web server - Check its logs in /var/log/ or journalctl -u your--weight: 500;">service
- Inspect its environment in /proc/<pid>/environ
- Verify it's listening on the right port via /proc/net/tcp
- Confirm DNS resolution is working via /etc/resolv.conf and /run/systemd/resolve/resolv.conf