|
|
@@ -167,7 +167,8 @@ EOF |
|
|
|
# Copy SSH keys to the server's authorized_keys file, removing any |
|
|
|
# existing keys with this HOSTID. |
|
|
|
log "Setting up SSH keys on remote host" |
|
|
|
cmd="borg/borg serve --restrict-to-repository ~/$BACKUP_REPO" |
|
|
|
REMOTE_BORG="borg/borg" |
|
|
|
cmd="$REMOTE_BORG serve --restrict-to-repository ~/$BACKUP_REPO" |
|
|
|
|
|
|
|
keys=".ssh/authorized_keys" |
|
|
|
backup="${keys}.old-$(date +%Y%m%d-%H%M%S)" |
|
|
@@ -183,7 +184,7 @@ EOF |
|
|
|
# Test that everything worked |
|
|
|
log "Testing SSH login with new key" |
|
|
|
if ! ssh -F "$SSH/config" -i "$SSH/id_ecdsa_appendonly" -T \ |
|
|
|
"${BACKUP_USER}@${BACKUP_HOST}" borg --version </dev/null ; then |
|
|
|
"${BACKUP_USER}@${BACKUP_HOST}" "$REMOTE_BORG" --version </dev/null ; then |
|
|
|
error "Logging in with a key failed -- is server set up correctly?" |
|
|
|
fi |
|
|
|
log "Remote connection OK!" |
|
|
|