- A Hetzner Cloud account.
- A ssh key
- Create 3 servers at Hetzner cloud in the "Nuremburg" region of type cpx11 with Ubuntu 20.04.
- Name them ansible, warpgate, target
- Connect to the ansible server (via root@ip) and run the following commands:
apt update && apt upgrade -y
apt install -y python3 python3-pip git
pip3 install ansible
cd /root/
git clone https://github.com/ntimo/warpgate-issue-459.git warpgate-issue-459
- Fill out the host_vars at
/root/warpgate-issue-459/ansible/host_vars/
- Ip of the warpgate vm
/root/warpgate-issue-459/ansible/host_vars/target_warpgate/main.yml
by replacing "<warpgate_ip_here>" with it. - Ip of the warpgate vm
/root/warpgate-issue-459/ansible/host_vars/target_jumphost/main.yml
by replacing "<warpgate_server_ip>" with it. - Ip of the target vm
/root/warpgate-issue-459/ansible/host_vars/target_jumphost/main.yml
by replacing "<target_ip_here>" with it. - Ip of the target vm
/root/warpgate-issue-459/ansible/host_vars/target_direct/main.yml
by replacing "<target_ip_here>" with it.
- Ip of the warpgate vm
- Generate a ssh key on the Ansible VM with no password using this command
ssh-keygen -t ed25519
- Copy your public ssh key for later
cat /root/.ssh/id_ed25519.pub
- Connect to the warpgate server (via root@ip) and run the following commands:
apt update && apt upgrade -y
apt install -y wget unzip
wget -O /tmp/nightly.zip https://nightly.link/warp-tech/warpgate/workflows/build/main/warpgate-main-x86_64-linux.zip
cd /tmp/
unzip /tmp/nightly.zip
mv /tmp/warpgate /usr/bin/warpgate
chmod +x /usr/bin/warpgate
warpgate unattended-setup --admin-password "pBu6ZkWzCopVt6M8b2rQEKzEYr3GABeg" --http-port "8080" --ssh-port "2233" --record-sessions --data-path "/var/lib/warpgate"
cat <<EOF > /etc/systemd/system/warpgate.service
[Unit]
Description=Warpgate
After=network.target
StartLimitIntervalSec=0
[Service]
Type=notify
Restart=always
RestartSec=5
ExecStart=/usr/bin/warpgate --config /etc/warpgate.yaml run
[Install]
WantedBy=multi-user.target
EOF
systemctl daemon-reload
systemctl enable --now warpgate
- Open the warpgate web ui at https://<warpgate_server_ip>:8080 and login with user:
admin
and password:pBu6ZkWzCopVt6M8b2rQEKzEYr3GABeg
- Go to
Manage Warpgate
- Then go to the
Config
menu - Create a new target with name
target
and type ssh - Enter the IP of your target server
- Make sure access for the
warpgate:admin
role is enabled - On the
Config
page click on theadmin
user and add the public key from the Ansible server - Change the Authentication policy to only allow key auth for ssh for the admin user
- Copy the ECDS key from the
SSH
page.
- Go to
- Connect to the target server via (root@) and add the ecda public key to the /root/.ssh/authorized_keys file
apt update && apt upgrade -y
apt install -y python3 python3-pip
echo "<ed25519_key>" >> /root/.ssh/authorized_keys
- Run the following command on the ansible server and confirm the warpgate detected ssh finterprint once your are in the remove shell type
exit
:
ssh 'admin:target@<warpgate_server_ip>' -p 2233 -i /root/.ssh/id_ed25519
- Now on the ansible server run the playbook:
cd /root/warpgate-issue-459/ansible/
ansible-playbook playbook_direct.yml --diff
ansible-playbook playbook_jumphost.yml --diff
ansible-playbook playbook_warpgate.yml --diff
- Run the playbook a few times in row you should see that the first connection is faster then the next ones. Here is one example:
- You can also run the playbook automatically a few times by running the tests.sh inside of the ansible directory (this will run each test 50 times and write the times to a
times_*.log
file) example result:
- You can also run the playbook automatically a few times by running the tests.sh inside of the ansible directory (this will run each test 50 times and write the times to a
0:00:16.303 *****
0:00:19.805 *****
0:00:19.800 *****
The results for an automated run (50 times) for each connection method are located in the results directory.
results plot: