solana/net/scripts/add-testnet-solana-user-aut...

24 lines
540 B
Bash
Raw Normal View History

#!/usr/bin/env bash
set -ex
[[ $(uname) = Linux ]] || exit 1
[[ $USER = root ]] || exit 1
[[ -d /home/solana/.ssh ]] || exit 1
2019-08-15 08:32:10 -07:00
if [[ -z $SOLANA_PUBKEYS ]]; then
echo "Warning: source solana-user-authorized_keys.sh first"
fi
# solana-user-authorized_keys.sh defines the public keys for users that should
2019-08-15 08:32:10 -07:00
# automatically be granted access to ALL testnets
for key in "${SOLANA_PUBKEYS[@]}"; do
echo "$key" >> /solana-authorized_keys
done
sudo -u solana bash -c "
cat /solana-authorized_keys >> /home/solana/.ssh/authorized_keys
"