Antonio Pitasi

A personal space for personal thoughts


Tuning SSH Config #

I’m going to outline a couple must configurations I use in my ~/.ssh/config:

  1. Automatically close connections on network failures:

    ServerAliveInterval 5
    ServerAliveCountMax 1

    This way SSH send an echo (a sort of ping) every 5 seconds, if didn’t get a reply for “1” times it closes the connection.

    But if you’re stuck in a session for some reason, you can always just press the following keys in order: <Enter>~..

  2. Set up usernames so you don’t have to type ssh all the time, but just ssh

        User antonio
    # works with wildcards too
    Host *
        User antonio

    just remember that rules are applied in order, so the first match wins. Run ssh -v and you’ll see something like debug1: /home/antonio/.ssh/config line 4: Applying options for