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

22 lines
563 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
if [[ ${#SOLANA_PUBKEYS[@]} -eq 0 ]]; then
2019-08-15 08:32:10 -07:00
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-scratch/authorized_keys
done
sudo -u solana bash -c "
cat /solana-scratch/authorized_keys >> /home/solana/.ssh/authorized_keys
"