Introduce `backtunnel-authorize` for managing restricted SFTP-only keys, and update `backtunnel-share` to support temporary accessor key authorization via `--allow-key` and `--allow-known`. Extend bash completion with profile, accessor, and SSH host suggestions. Revamp README sections to include updated workflows, quick starts, and key management details.
10 lines
330 B
Bash
10 lines
330 B
Bash
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
name="${1:-}"
|
|
file="${2:-}"
|
|
[[ -n "$name" && -n "$file" && -f "$file" ]] || { echo "Usage: backtunnel-authorize <name> <pubkey-file>"; exit 1; }
|
|
dir="${XDG_CONFIG_HOME:-$HOME/.config}/backtunnel/authorized"
|
|
mkdir -p "$dir"
|
|
install -m 644 "$file" "$dir/$name.pub"
|
|
echo "Saved: $dir/$name.pub"
|