Visual Studio - connect to AWS instance via bastion server - amazon-web-services

I am developing some machine learning code and I just got an AWS instance for that. To access the instance, I need to
ssh from the local machine to a bastion server (which is also an AWS instance).
ssh from the bastion server to the development machine.
For development, I would like to attach Visual Studio to the remote machine. Is there a way for doing that? I tried adding a ~/.ssh/config file with the login credentials in the bastion server, but that does not change the available hosts listed by Visual Studio.

I think you need to use this plugin and follow this blog:
https://code.visualstudio.com/blogs/2019/10/03/remote-ssh-tips-and-tricks#_proxycommand
For a quick description, it will open a connection to the bastion in the background, and then it will connect to your development instance

Related

linux rdp to EC2 windows machine - error "lost connection to the RDP server"

I created a simple EC2 instance (windows 2016), and without security group (all traffic allowed), and got public IP and DNS (created by the VPC).
Then I downloaded the rdp file from the EC2 in order to remote connect to the EC2, and got "lost connection to the RDP server...".
I use my linux (fedora) machine, and use remmina to remote connect.
I'm new with AWS, am I missing something that I need to do before I connect?
P.S. I don't have IAM role, and also I didn't use the .pem file I downloaded - I don't know if it's related.

Accessing a dev server when doing remote / cloud development

I'm attempting to find a completely remote / cloud-based development workflow.
I've created an aws free-tier ec2 instance and on that box I've been developing a gatsby site (the framework doesn't matter, the solution I'm looking for should be framework agnostic). Since the code is on another box, I can't run the dev server and then from the local computer hit localhost as I would normally.
So,
What do I need to do so that I can run gatsby develop and hit my dev server that's hosted on the ec2 box?
How do I provide public access to that endpoint?
Is it possible to provide temporary access so that when I log off of the box, it's no longer accessible?
Is there some mechanism I can put into place so that I'm the only one that can hit that endpoint?
Are there other features that I should be taking advantage to secure that endpoint?
Thanks.
I can't run the dev server and then from the local computer hit localhost as I would normally
You can. You can use ssh to tunnel your remote port to your localhost, and access the server from your localhost.
What do I need to do so that I can run gatsby develop and hit my dev server that's hosted on the ec2 box?
ssh into the dev server, run gatsby develop and either access it on localhost through ssh tunnel or make it public to access through its public IP address.
Use sshfs to mount a development folder on the dev server onto your localhost.
Alternatively, you can setup vncserver on the dev server, tunnel vnc connection using ssh, and access the dev server using through a remove desktop. Something liteweight would be good, e.g. fluxbox as a desktop environment for vnc.
Is it possible to provide temporary access so that when I log off of the box, it's no longer accessible?
yes. through ssh tunnel. You close tunnel and the access is finished.
Is there some mechanism I can put into place so that I'm the only one that can hit that endpoint?
ssh tunnel along with security group to allow ssh for your IP address only.
Are there other features that I should be taking advantage to secure that endpoint?
Security groups and ssh tunneling would be primary choices to ensure secure access to the dev server.
You can also make the endpoint public, but set security group of your dev server to allow internet access only from your IP.
You could also put the dev server in a private subnet for full separation from the internet. Use bastion host to access it or setup double ssh tunnel to your localhost.
Other way is to do all development on localhost, push code to CodeCommit and have CodePipeline manage deployment of your code to your dev server using CodeDeploy.
You can also partially eliminate ssh by using SSM Session Manager.
Hope this helps.

How to access Amazon EC2 files via web browser

So I have an Amazon EC2 Free Tier Instance with Debian Jessie. There's a software running that generates an html file I'd like to access remotely.
When connected to the instance via SSH, I can remotely open a web browser and go to 127.0.0.1:8083/index.html?PARAMETER1=...&PARAMETER2=...
Now doing this is very tedious because the browser is slow. I'd like to be able to access to this file directly using the web browser in my local machine.
How do I do this? I tried replacing 127.0.0.1 with the Public IPv4 but it won't work. Do I have to open the port?
Thanks.
You would need to open port 8083 using the security groups inbound rules for the ec2 instance. Then use the public IP to access the file.

how to create a amazon cloud machine using ec2

I am new to the amazon world.
I have got an amazon ec2 machine with it's public dns and a .pem file . i have connected to the machine using putty by generating a ppk file . now i am able to login to the remote machine using root user. Can someone help me how to create a remote desktop machine or as a cloud machine like the way windows has a rdp feature so that i can install the software. Do i need to install vncserver on it ?. if yes, is there any handy video or documentation which can provide me steps to connect . i have to install appache 2 and mysql on it.
Appreciate your help.
P.S. I can't see any instance on the amzon ec2 which can be created with the machine dns i have got.
Thanks.
1) To see you instance in AWS Console, you need to choose region, where that ec2 server is deployed.
Click on right top menu, there is list of regions there.
2) As we understood, you need to install LAMP Server on that instance.
There are lots of examples how to do it (without GUI, using command line interface).
Find them easily typing how to setup lamp server on ubuntu/centos, depending on your OS.

WCF service in Windows service on Amazon EC2

I'm fairly new to EC2, hopefully someone can point me into the correct direction. I have a WCF Service hosted in Windows Service and would like to run this on EC2. I set up an EC2 account with Windows Server 2008 with SQL Server Express. I put my service out there and ran it, I'm able to test and connect to it from the browser with the private IP on the VM, but when I try to connect to the service from my computer with the Public IP, I'm not able to do so.
Am I missing some important configuration or am I totally off? Any help would be greatly appreciated. I'm testing this with port 8080 and added that to the Permission Groups. I also tried to assigned an elastic IP to the instance. Thanks in advance.
EC2 provides security groups, which are essentially a firewall external to the machine. The default security group will allow SSH and RDP connections. If you want requests for port 8080 to be received by the VM, update the security group settings for the VM. You can do this interactively from the Amazon Management Console.
You also need to configure the firewall running in the windows VM, but it appears you did this when you added the service to the 'Permission Groups'.