add script to add key to server
This commit is contained in:
parent
ee7ca28793
commit
83ec81f0ab
1 changed files with 13 additions and 0 deletions
13
add-key-to-server.sh
Executable file
13
add-key-to-server.sh
Executable file
|
@ -0,0 +1,13 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
if [ $# -lt 2 ]; then
|
||||||
|
echo "$0 server keyname [keyname...]"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
server=$1; shift
|
||||||
|
|
||||||
|
for keyname in "$@"; do
|
||||||
|
url=https://key.wf/${keyname}
|
||||||
|
ssh root@$server "curl -Ls $url >> ~/.ssh/authorized_keys" < /dev/null
|
||||||
|
done
|
Loading…
Reference in a new issue