Prepare the target hosts
Give the collector an SSH user and one sudoers line on each Linux host. Nothing else goes on the host.
Before you start
The host must have:
- Linux with
sh,ps,ip(iproute2) andss(iproute2). - An SSH server.
Make the SSH user
Make a user without a password, for example
shellgraph.useradd -m -s /bin/sh shellgraphAdd the public key of the credential to
~shellgraph/.ssh/authorized_keys.
Add the sudoers line
Without sudo, ss does not show the process of the sockets of other users. Then most services show as unknown:<port>.
Find the path of
ss.command -v ssOpen the file
/etc/sudoers.d/shellgraph.visudo -f /etc/sudoers.d/shellgraphAdd this line. Use the path from step 1.
shellgraph ALL=(root) NOPASSWD: /usr/sbin/ss -tanpH
Do not add a wildcard (*) to the line. A wildcard can give root access, see Collector security.
Let the collector name the containers
The collector finds Docker and Podman containers without the container runtime. To show the name of a container, and not its short ID, the SSH user must be able to run docker ps or podman ps. This step is optional.
Test the host
Collect the host from the collector machine, without the server:
shellgraph probe -i ~/.ssh/id_ed25519 shellgraph@10.0.10.12
See Diagnose one host.