prefer ed25519 keys if they exist

This commit is contained in:
James Tomasino 2019-04-22 11:37:35 -04:00
parent c0b8252fea
commit b8d10dcdcb
2 changed files with 14 additions and 2 deletions

14
lssh
View File

@ -1,6 +1,6 @@
#!/bin/sh
version="2019.04.19"
version="2019.04.22"
arg_options="hv"
key=""
@ -80,6 +80,18 @@ main () {
break;
fi
if [ -d "${path}${key}" ]; then
# check keys in order of crypto awesomeness
# TODO: replace this with some listing of types or generic regex
if [ -f "${path}${key}/id_ed25519" ]; then
printf "Found key at: %s\\n" "${path}${key}/id_ed25519"
KEY_ID="${path}${key}/id_ed25519"
break;
fi
if [ -f "${path}${key}/id_dsa" ]; then
printf "Found key at: %s\\n" "${path}${key}/id_dsa"
KEY_ID="${path}${key}/id_dsa"
break;
fi
if [ -f "${path}${key}/id_rsa" ]; then
printf "Found key at: %s\\n" "${path}${key}/id_rsa"
KEY_ID="${path}${key}/id_rsa"

2
lssh.1
View File

@ -1,4 +1,4 @@
.TH LSSH 1 "19 Apr 2019" "version 2019.04.19"
.TH LSSH 1 "22 Apr 2019" "version 2019.04.22"
.SH NAME
lssh \- a wrapper for Lastpass CLI and ssh-agent
.SH SYNOPSIS