A private server is a server that is not exposed to the internet. Create private servers in the QuickLab network's private subnets.
List servers in the QuickLab network
aws ec2 describe-instances \
--filters "Name=vpc-id,Values=$(terraform output network_id)" "Name=instance-state-name,Values=pending,running,shutting-down,stopping,stopped" \
--query 'Reservations[*].Instances[*].{InstanceId:InstanceId, Name:Tags[?Key==`Name`]|[0].Value, PrivateDnsName:PrivateDnsName, State:State.Name}' \
--output table
create private servers
- use the included shell script (
create-server.sh) - execute the script from the terraform project directory (e.g.
aws) - specify the system type ("windows" OR "linux") using the
-sparameter - (optional) specify the count of servers to create using the
-cparameter (default:1) - servers are created using the latest Amazon Linux 2023 and Windows Server 2022 Images
- run the script twice to create Linux and Windows servers
- example command:
chmod +x modules/bastion/create-server.sh && ./modules/bastion/create-server.sh -s linux
delete private servers
- use the included shell script (
delete-server.sh) - execute the script from the terraform project directory (e.g.
aws) - the script only deletes servers created by
create-servers.sh - example command:
chmod +x modules/bastion/delete-server.sh && ./modules/bastion/delete-server.sh
The QuickLab bastion facilitates connections to private servers. Servers created using create-server.sh use the same KeyPair as the QuickLab bastion.
-
note the PrivateDnsName of your server
- example command:
PrivateDnsName=ip-10-0-10-12.us-west-2.compute.internal
- example command:
-
connect to the server using the included ssh config file
- example command:
ssh -F $(terraform output -raw bastion_proxyjump_config) $PrivateDnsName
- example command:
-
note server's InstanceId and PrivateDnsName
- example command:
InstanceId=i-0db3f0a9221f42922 && PrivateDnsName=ip-10-0-11-128.us-west-2.compute.internal
- example command:
-
decrypt server's password
- example command:
aws ec2 get-password-data --instance-id $InstanceId --priv-launch-key $(terraform output -raw network_keyfile) --query {AdminPassword:PasswordData} --output text
- example command:
-
tunnel RDP traffic through an SSH connection to the QuickLab Bastion
- example command:
eval $(terraform output -raw bastion_connect) -L 3389:$PrivateDnsName:3389
- example command:
-
use an RDP client to initiatiate an RDP connection to
localhostusing the generated RDP connection file- example command:
open ~/quicklab/aws/localhost.rdp
- example command:
-
log in using the server's credentials, e.g
- username:
Administrator - password:
<decrypted password>
- username: