~ajk/ssh-identity-wrapper

ref: 2a1d31688ca71cf00b56cc2625190f33f78e7daa ssh-identity-wrapper/ssh-wrapper.sh -rwxr-xr-x 368 bytes
2a1d3168 — Andrew Kay Update usage documentation 9 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/bash

cd $(dirname -- "$(readlink -f -- "$BASH_SOURCE")")

source ./ssh-wrapper.conf.sh

read -p 'Identity: ' identity

if [ ! -v identities[$identity] ]; then
    echo 'Invalid identity'
    exit 1
fi

key_path=${identities[$identity]}

if [ ! -f $key_path ]; then
    echo 'Invalid identity'
    exit 1
fi

SSH_AUTH_SOCK="" ssh -F /dev/null -i $key_path "$@"