Skip to content

Commit

Permalink
Merge pull request #9 from Automattic/skoonin/add_ssh_key_to_agent
Browse files Browse the repository at this point in the history
Add SSH Key to Agent Function
  • Loading branch information
skoonin authored Jan 13, 2022
2 parents c101664 + 370bf07 commit 643f807
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions bin/add_ssh_key_to_agent
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash -eu

NEW_SSH_KEY=$1
NEW_SSH_KEY_NAME=$2

# Create key in ~/.ssh dir
echo "$NEW_SSH_KEY" > ~/.ssh/"$NEW_SSH_KEY_NAME"
chmod 0600 ~/.ssh/"$NEW_SSH_KEY_NAME"

# Add new key to Agent
ssh-add ~/.ssh/"$NEW_SSH_KEY_NAME"
ssh-add -l

0 comments on commit 643f807

Please sign in to comment.