-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
Description
Is your feature request related to a problem? Please describe.
On macOS you can use ssh-add --apple-use-keychain (described here) to use credentials from the keychain instead of it asking for passwords, so it would be nice if that was an option.
Describe the solution you'd like
The simplest solution to make it an option would be to add something like this
zstyle ':zim:ssh' use-keychain trueDescribe alternatives you've considered
I did some local modifications and came up with this that seems to work
Modified ssh/init.zsh
# Load identities
ssh-add -l &>/dev/null
if (( ? == 1 )); then
PARAMS=""
local enable_apple_keychain
zstyle -s ':zim:ssh' use-keychain enable_apple_keychain || enable_apple_keychain=false
if [[ $(uname) == 'Darwin' && ${enable_apple_keychain} == true ]]; then
PARAMS='--apple-use-keychain'
fi
local -a zssh_ids
zstyle -a ':zim:ssh' ids 'zssh_ids'
if (( ${#zssh_ids} )); then
ssh-add ${PARAMS} ${HOME}/.ssh/${^zssh_ids} 2>/dev/null
else
ssh-add ${PARAMS} 2>/dev/null
fi
fiThere is probably a nicer way of doing it and I haven't tested it on linux, but it does what it's supposed to on macOS
Additional context
No response