A Zsh plugin that starts ssh-agent
automatically if it is not already running.
Using the ⚡ Zap Zsh plugin manager, add the following to
your .zshrc
plug "sdiebolt/zsh-ssh-agent"
To set a maximum lifetime when adding identities to ssh-agent
, add the lifetime
style to your .zshrc
before the line that installs the plugin. The lifetime may be
specified according to sshd_config(5)
(see TIME FORMATS
). If left unspecified, the
default lifetime is forever.
zstyle :plugins:ssh-agent lifetime 4h
To automatically add keys to ssh-agent
, add the following to your ~/.ssh/config
file:
AddKeysToAgent yes
This plugin is based on the Oh My Zsh plugin zsh-ssh-agent. Unfortunately, the Oh My Zsh plugin cannot be installed as a standalone plugin using ⚡ Zap.