Last active
August 5, 2022 21:27
-
-
Save dloman/a892fdac0150c87d2f6aa095c835a722 to your computer and use it in GitHub Desktop.
sshpiper add
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/bash | |
if [ $1="-h" ]; then | |
echo "USAGE: sshpiperadd.bash \$NAME \$USERNAME \$IP " | |
exit | |
fi | |
if [ "$#" -ne 4 ]; then | |
echo "USAGE: sshpiperadd.bash \$NAME \$USERNAME \$IP " | |
exit | |
fi | |
NAME=$1 | |
USERNAME=$2 | |
IP=$3 | |
sudo sshpiperd pipe add -n $NAME -u $IP --upstream-username $USERNAME | |
sudo ln -s /home/sbhx/.ssh/authorized_keys /var/sshpiper/$NAME/authorized_keys | |
sudo ssh-keygen -N '' -f /var/sshpiper/$NAME/id_rsa | |
sudo ssh-copy-id -i /var/sshpiper/$NAME/id_rsa.pub $USERNAME@$IP | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment