#!/bin/sh

# This script should be run inside tails 3.x. It setups a test environment to
# use with build_and_test.sh. Usage:
#
#     install_test_setup <NETWORK FROM WHICH SSH IS ALLOWED>
#
# See HACKING for details.

set -x
set -e

/usr/local/lib/tails-unblock-network
dpkg -i openssh-*.deb
iptables -I INPUT 1 -p tcp --dport 22 -s "$1" -j ACCEPT
mkdir /root/.ssh/
chmod o+rX /root/.ssh/
cp ./authorized_keys /root/.ssh/
