Andri Setiawan

ssh

~/.ssh/config blocks and a hardened sshd_config

Client: ~/.ssh/config

Give a server a short name once, then type ssh web1 instead of the whole command every time. The block goes in ~/.ssh/config on your own computer.

Options
~/.ssh/config
then just
instead of

    No key yet? ssh-keygen -t ed25519 -C "you@laptop", then ssh-copy-id web1 to put it on the server.

    Server: hardened sshd_config

    A drop-in file for the SSH server. On Debian, Ubuntu and most current distros, /etc/ssh/sshd_config.d/*.conf is read first, and sshd keeps the first value it sees, so this file wins over the defaults.

    Options
    /etc/ssh/sshd_config.d/90-hardening.conf
    test, then apply

      Works on my machine™. This is a starting point, not a guarantee: read it, test it, and keep that second SSH session open. Disclaimer

      More tools