Use dropbearkey to send keyfile is needed

This commit is contained in:
Michael Stanclift 2020-06-01 10:43:55 -05:00
parent 34d43eb238
commit d8ca2380ce
2 changed files with 9 additions and 2 deletions

View File

@ -14,6 +14,7 @@
#### 1.7.6
- Detects `dbclient` install as alternative to OpenSSH Client. (DietPi)
- Attempts to install OpenSSH Client if not found, and Dropbear is not alternative. (DietPi)
- Fix bug with `dropbearkey` not finding .ssh folder
#### 1.7.5
- No code changes!
@ -31,7 +32,7 @@
- Fixes `custom.list` not being processed by `./gravity-sync.sh restore` function.
- Detects absence of `ssh` client command on host OS (DietPi)
- Detects absence of `rsync` client command on host OS (DietPi)
- Detects absence of `ssh-keygen` utility on host OS and will use dropbearkey as an alternative (DietPi)
- Detects absence of `ssh-keygen` utility on host OS and will use `dropbearkey` as an alternative (DietPi)
- Changelog polarity reversed after heated discussions with marketing team.
#### 1.7.3

View File

@ -929,7 +929,13 @@ function config_generate {
echo -e "========================================================"
echo -e "========================================================"
ssh-copy-id -f -i $HOME/${SSH_PKIF}.pub ${REMOTE_USER}@${REMOTE_HOST}
if hash ssh-copy-id 2>/dev/null
then
ssh-copy-id -f -i $HOME/${SSH_PKIF}.pub ${REMOTE_USER}@${REMOTE_HOST}
elseif hash dropbearkey 2>/dev/null
then
dropbearkey -t ecdsa -f $HOME/${SSH_PKIF} | grep "^ecdsa" > $HOME/${SSH_PKIF}.pub
cat $HOME/${SSH_PKIF}.pub | dbclient ${REMOTE_USER}@${REMOTE_HOST} 'cat - >> .ssh/authorized_keys'
echo -e "========================================================"
echo -e "========================================================"
else