2019-08-14 13:25:56 -07:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -ex
|
|
|
|
|
|
|
|
[[ $(uname) = Linux ]] || exit 1
|
|
|
|
[[ $USER = root ]] || exit 1
|
|
|
|
|
|
|
|
[[ -d /home/solana/.ssh ]] || exit 1
|
|
|
|
|
2019-09-12 16:11:13 -07:00
|
|
|
if [[ ${#SOLANA_PUBKEYS[@]} -eq 0 ]]; then
|
2019-08-15 08:32:10 -07:00
|
|
|
echo "Warning: source solana-user-authorized_keys.sh first"
|
|
|
|
fi
|
2019-08-14 13:25:56 -07:00
|
|
|
|
|
|
|
# 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
|
2019-08-14 13:25:56 -07:00
|
|
|
for key in "${SOLANA_PUBKEYS[@]}"; do
|
2019-09-03 17:51:16 -07:00
|
|
|
echo "$key" >> /solana-scratch/authorized_keys
|
2019-08-14 13:25:56 -07:00
|
|
|
done
|
|
|
|
|
|
|
|
sudo -u solana bash -c "
|
2019-09-03 17:51:16 -07:00
|
|
|
cat /solana-scratch/authorized_keys >> /home/solana/.ssh/authorized_keys
|
2019-08-14 13:25:56 -07:00
|
|
|
"
|