Skip to content
This repository was archived by the owner on Jan 30, 2020. It is now read-only.

Commit 57cf528

Browse files
committed
Merge pull request #1234 from zvbuhl/fleetctl-ssh
scripts: add SSH key replacement & removal
2 parents f8c5c92 + 9f5ba8a commit 57cf528

2 files changed

Lines changed: 28 additions & 0 deletions

File tree

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash -x
2+
3+
name=$1
4+
if [ -z $name ]; then
5+
echo "Provide the name of the keys to remove"
6+
exit 1
7+
fi
8+
9+
shift 1
10+
11+
for machine in $(fleetctl $@ list-machines --no-legend --full | awk '{ print $1;}'); do
12+
fleetctl $@ ssh $machine "update-ssh-keys -d $name -n"
13+
done
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash -x
2+
3+
name=$1
4+
if [ -z $name ]; then
5+
echo "Provide a name for the injected SSH key"
6+
exit 1
7+
fi
8+
9+
shift 1
10+
11+
pubkey=$(cat)
12+
13+
for machine in $(fleetctl $@ list-machines --no-legend --full | awk '{ print $1;}'); do
14+
fleetctl $@ ssh $machine "echo '${pubkey}' | update-ssh-keys -a $name"
15+
done

0 commit comments

Comments
 (0)