summaryrefslogtreecommitdiff
path: root/addkey
blob: 692624918d9f98cec98f41b0f826c7e8485a215d (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 +/=:\n-' | sed 's/^/restrict,pty /' - >>"$HOME/.ssh/authorized_keys"

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