Git Product home page Git Product logo

cloudvirtualmachine's Introduction

CloudVirtualMachine

CloudVirtualMachine (CVM) serves to allow one to easily provision cheap, stateless working EC2 instances on the AWS cloud. Think of it as a Terminal.

How to use

Connect to Bastion host

Your instance is isolated and fronted by a Bastion. Therefore, to connect to your instance you need to jump via your Bastion. This is how to do it.

  1. Send public SSH key to EC2.

EC2 Instance Connect works by uploading a one-time SSH public key to the Bastion host, which will grant you access via your SSH client of choice. After deployment, a pre-formatted CLI command with by outputted for you to paste into your console. It looks something like this:

aws ec2-instance-connect send-ssh-public-key --instance-id i-xxxxxxxxxxxx --instance-os-user ec2-user --ssh-public-key file://C:\Users\whoever\CloudVirtualMachine\temp_key.pub --availability-zone eu-west-1a
  1. Connect via SSH

Once your public SSH key has been sent to EC2, you can now connect using the SSH client of your choice. Similarly, a sample command is generated for you. For example:

ssh -o "IdentitiesOnly=yes" -i C:\Users\whoever\CloudVirtualMachine\temp_key.pem [email protected]

Jump to worker Instance

From your Bastion host, you can now jump to your worker Instance.

cloudvirtualmachine's People

Contributors

farrout avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

cloudvirtualmachine's Issues

VNC bootstrap

install and configure VNC remote desktop daemon programmatically and non-interactively...

Automate sending EC2 Instance Connect public keys

Currently the command to send-ssh-public-key is although printed as an Output, still needs to be executed manually by the user.

        send_key_command = f"aws ec2-instance-connect send-ssh-public-key --instance-id {bastion.instance_id} --instance-os-user {bastion_user} --ssh-public-key file://{public_key_key} --availability-zone {az}"
        CfnOutput(self, 'SendPublicSshKeyCommand',
                  value=send_key_command,
                  description='Command to send public SSH key to Bastion.',
                  )

        ssh_command = f"ssh -o \"IdentitiesOnly=yes\" -i {private_key_path} {bastion_user}@{bastion.instance_public_dns_name}"
        CfnOutput(self, 'BastionSSHcommand',
                  value=ssh_command,
                  description='Command to SSH into Bastion.',
                  )

It would be nice if this was taken care of seamlessly during deployment. Step Functions perhaps??

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.