Can not connect to Amazon EC2 Window Instance? - amazon-ec2

I was only provided an Amazon EC2 Window Instance: ec2-54-200-63-126.us-west-2.compute.amazonaws.com.
When I try to connect to it by using Remote Desktop Connection. It notify that:
Rmote Desktop can't connect to the remote computer for one of these reason:
1) Remote access to the server is not enabled
2) The remote computer is turned off
3) The remote computer is not available on the network
I had searched for an hour and see that I have config something with this instance?
Is there any guide, blog, website for config new instance to be connected?

Have you configured a security group (basically a firewall) for the server that has the RDP port open?

Related

EC2 Instance Connect (browser-based SSH connection) doesn't work

Trying to connect Amazon AWS EC2 instance fails.
Platform: Amazon Linux
Connection method: EC2 Instance Connect (browser-based SSH connection)
Error: There was a problem setting up the instance connection
Log in failed.
If this instance has just started up, try again in a minute or two.
Note: I am able to connect via Putty / SSH Client. But same instance can't connect via browser.
When checked network logs in browser's developer tool, see a Status Code: 400 Bad Request for following URL:
https://ec2-instance-connect.us-east-2.managed-ssh.aws.a2z.com/ls/api/tokens
Has anyone ever successfully connected to Amazon Linux EC2 instance from browser.
To test, I just did the following:
Launched an Amazon Linux 2 EC2 instance with the default security group
Clicked "Connect" in the EC2 management console
Selected "EC2 Instance Connect"
Clicked "Connect"
A new browser tab opened and a few seconds later I had a working SSH connection.
I then tried it again with an Amazon Linux (not Amazon Linux 2) instance and got the error:
There was a problem setting up the instance connection
Log in failed. If this instance has just started up, try again in a minute or two.
This is because the EC2 Instance Connect client is only pre-installed on Amazon Linux 2 and Ubuntu 16.04 or later.
You can use EC2 Instance Connect with your ssh client. In case you really need the browse-based connection, your security group must have a rule allowing SSH connections (port 22) from 0.0.0.0/0. Not much secure in my point of view...
This is for AWS Lightsail, I could not use browser to connect via SSS, instead I was able to connect via SSH using macOS terminal. I was able to login via SSH by appending my public key id_rsa.pub contents to the remote authorized_keys file, I used SFTP (Filezilla) to update authorized_keys file. For SFTP connection I downloaded ssh key from Accounts page.

How to rdp from mac to azure vm through vnet gateway

I am trying to rdp from my local mac to an Azure instance through a (IKEv2) vpn connection. I am never prompted for a password, and it looks like the connection just times out. The error code I get is 0x204.
I have tried using both Microsoft Remote Desktop 8 and 10 for mac.
The connection is active and reports that it is connected.
From the mac, I can connect to another VM (in the same azure account) which is not running behind a vpn.
From Parallels Desktop (with networking set to Shared mode and the vpn connection active on the mac), I can successfully connect using the windows rdp client.
So it seems the Microsoft RDP-client for mac is not using the vpn connection.
Is there a way to make it do so?
Is there another solution, that will allow me to rdp to an Azure VM from my mac (without going through Parallels)?
Note: This is not the same question as this, since that is not about going through an azure vnet gateway.
I needed to add hosts file entries for each azure site I needed to access.
For example for accessing my-vm-name.someregion.cloudapp.azure.com, I needed to add a hosts file entry for it's private IP within the subnet. E.g. 10.2.0.100.
The reason everything worked in Windows under Parallels, is that the relevant entries had already been added to the hosts file previously.

Is there any way to connect to the VPN from the EC2 windows instance?

I have a vpn connection for a company. I want to open that vpn connection in a ec2 windows server to open their private url in a ec2 windows server. I am looking for some manual solution. After that, I am planning to do the same connection using aws sdk with ruby.
Any help?
Since, your requirement is to connect to a custom VPN from the EC2 windows box, you can simply use a VPN client. Most popular one would be Cisco AnyConnect and if you need a Open-Source one, I can suggest OpenVPN

Lost rdp access to EC2 instance

I changed the firewall (on windows server ) of an Amazon EC2 instance to accept the Remote Desktop connections only for a specific IP address .
Once changes are done , i lost connection and i am no longer able to access the instance .
my question is :
is there a way to access this instance again or is it completely lost ?
You might be able to use Windows Remote Management (WinRM) to open a console to the machine and change the firewall setting from the command line.
WinRM uses port 5985 and it is on by default on some windows images on EC2 (not all of them). Try opening port 5985 in your security group and log in with a Powershell client.
There are some instructions on how to use powershell for WinRM here: How to programmatically/remotely execute a program in EC2 Windows instance
You can run the steps in the script manually.

Connecting to server behind VPN with Heroku and Ruby

I'm writing an application in Ruby/RoR that will be hosted on Heroku.
One of its requirements is that it connects to an (Active Directory) authentication server which is behind a Sonicwall VPN.
How can I establish this VPN authentication using Ruby to access this server?
Heroku is just a service built on top of EC2 that manages deployment using a linux env. You don't have root access on on which means you can connect out to any service using any TCP protocol. But you can only listen for HTTP connections. Unfortunately this rules out setting up VPNs and SSH tunnels. You can do this on Amazon EC2.

Resources