in /etc/profile (or bashrc)

eval $(ssh-agent -s)
ssh-add ~/.ssh/id_ed25519
ssh -o 'ForwardAgent yes' gateway 'ssh-add'

In ssh/config

Host *
    AddKeysToAgent confirm 1d

View this post on Github

You might also enjoy…

Mike Street

Written by Mike Street

Mike is a CTO and Lead Developer from Brighton, UK. He spends his time writing, cycling and coding. You can find Mike on Mastodon.