summaryrefslogtreecommitdiff
path: root/addkey
diff options
context:
space:
mode:
authorGravatar steering72532026-05-18 01:25:46 -0600
committerGravatar steering72532026-05-18 01:25:46 -0600
commitdc54a69b7552d8d44adf25b8009992c4a2b395be (patch)
tree0c1864e9239bf02fc83408be378d983070250ead /addkey
init
Diffstat (limited to 'addkey')
-rwxr-xr-xaddkey8
1 files changed, 8 insertions, 0 deletions
diff --git a/addkey b/addkey
new file mode 100755
index 0000000..e8bda98
--- /dev/null
+++ b/addkey
@@ -0,0 +1,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"