summaryrefslogtreecommitdiff
path: root/addkey
blob: e8bda982095d012b9a49c755fd6409c63aba1844 (about) (plain) (blame)
1
2
3
4
5
6
7
8
#!/bin/bash
# Add a key (or keys) to your authorized_keys

[ -t 0 ] && echo "Paste in your authorized_keys content, then press ^D"
tr -dc '-a-zA-Z0-9 +/=:' | sed 's/^/restrict,pty /' - >>"$HOME/.ssh/authorized_keys"

echo "New keys:"
cat -n "$HOME/.ssh/authorized_keys"