~ajk/ssh-identity-wrapper

3776213380c637d91bea64ca1b519132475f38a6 — Andrew Kay 5 months ago 2a1d316 master
Rename to ssh-identity-wrapper
3 files changed, 7 insertions(+), 7 deletions(-)

M README.md
R ssh-wrapper.conf.sh => ssh-identity-wrapper.conf.sh
R ssh-wrapper.sh => ssh-identity-wrapper.sh
M README.md => README.md +3 -3
@@ 1,4 1,4 @@
# ssh-wrapper
# ssh-identity-wrapper

A simple SSH wrapper that prompts for the identity.



@@ 6,12 6,12 @@ I use this as a host process for dumb terminals to provide terminal server funct

## Usage

You will need to update the `ssh-wrapper.conf.sh` file to map identity names to identity files (the private keys).
You will need to update the `ssh-identity-wrapper.conf.sh` file to map identity names to identity files (the private keys).

To use the SSH wrapper:

```
ashford% ssh-wrapper.sh scud
ashford% ssh-identity-wrapper.sh scud
Identity: andrew
Enter passphrase for key '_keys/andrew': 
Last login: Sun Nov 24 14:15:13 2019 from 192.168.1.103

R ssh-wrapper.conf.sh => ssh-identity-wrapper.conf.sh +0 -0

R ssh-wrapper.sh => ssh-identity-wrapper.sh +4 -4
@@ 2,19 2,19 @@

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

source ./ssh-wrapper.conf.sh
source ./ssh-identity-wrapper.conf.sh

read -p 'Identity: ' identity
read -p "Identity: " identity

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

key_path=${identities[$identity]}

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