and welcome back to BackSpace Academy. In this lesson I'm going to run through 2
what we previously did with connecting to ec2 windows and ec2 Linux instances 3
but I'm going to do it using a Mac instead of using a Windows PC so if 4
you're a Windows PC user you can skip over this lesson it's not for you. So now 5
in the ec2 management console will launch an instance and we'll select the 6
Amazon Linux AMI and a t2 Nano and we'll auto assign a public IP. We'll skip over 7
that and we'll go to security group so we've got a security group there for SSH 8
on port 22 which is fine for us so we just review and launch so I'm just going 9
to create a new key pair here okay so now we'll just download that keep in and 10
I'll launch that instance 11
okay so that's currently pending and after a certain amount of time it will 12
be up and running okay we can see there now that our ec2 instance is up and 13
running so we just select that and then we'll click on connect. So the first 14
thing we need to do is to change permissions on our pem. file that we 15
downloaded previously when we created the ec2 instance and then once we've 16
done that we can connect to our instance using the terminal using that endpoint 17
So I'm just going to jump into the terminal and I'm just going to create a 18
directory for putting this key pair into there 19
Okay so just created that there now and so I'll just CD into that now 20
I'll just jump back in and grab that file and I'll put it into that location 21
So first of all I'll just get Finder up 22
and there's the key pairs directory. Back into Chrome and grab that file 23
I am going to copy that file over to the key pairs directory that I just 24
created. Okay so that's that done. Okay so it's fine. So now it's just got to create 25
or to do a command to change the permissions on that file. So I just jump 26
back into here grab that command, save me typing it out 27
just put your password in there and that's change the permissions on that 28
for us. So now we've got that that key pair file located there and we're in 29
that directory where our key pair is, so we can now look at connecting into our 30
instance through the terminal. So I just jump back into Chrome just grab this and 31
AWS made life a lot easier for us here so there's it's given us the actual 32
command that we need to use in terminal. So we just copy that over and place that 33
in and just typing is for that and there we go we eventually connect it into the 34
Linux instance in and so we can do our sudo yum update if we want and there we 35
go. So we've success successfully connected into our Linux instance using 36
a Mac something new for me I'm not a Mac user so it was quite interesting to get 37
to do this that life is a lot easier for Macs as compared to Windows. So this as 38
you can see we just go straight into terminal there's no using putty or 39
anything like that you just go straight in and and it's it's a lot easier it's 40
very easy very similar to the process that you use with with Linux as well. So 41
now that we've launched an ec2 instance we have connected into it with SSH and 42
we've run some commands in the terminal from our Mac this will have a look now 43
at using SFTP to transfer files from our Mac across to the EBS volume that is 44
attached to our ec2 instance. So we use FileZilla the same as we would with 45
Windows so just go to the FileZilla website and download and install 46
FileZilla then once you've got it up and running just go to file site manager and 47
then create a new site now our host will be the public IP 48
address of our ec2 instance. So I'm just going to jump back into the browser 49
and I can see here this is the public IP address of that ec2 instance that I want 50
to connect to and we're going to connect on with port 22 for SSH and our protocol 51
will be SSH File Transfer Protocol or SFTP and we're going to be logging on 52
using our key file or our key pair so what we need to do is just browse for 53
that key pair and we just download that and there it is now our our user because 54
it is in an amazon linux ami you will be ec2 - user will be the user if it was 55
an Ubuntu AMI, the user would be ubuntu. So we just connect into 56
that now and just trust this host not a problem 57
So just connect it in its retrieving the home directory of this and there we can 58
see so we've got our our EBS volume that we're having a look at now so we've got 59
our home directory then which is ec2 user and that looks all pretty good. So 60
now we'll look at connecting to a Windows Server instance from the Mac so 61
again let's launch an instance so this time we're going to look for a Windows 62
Server standard edition, we don't want the data center edition, we're looking 63
for a, so here we go, so Microsoft Windows 2012 Standard Edition is the one we're 64
looking for. So we'll select that we'll select a nano 65
instance for that 66
and we'll go along and we'll make sure that there's a public IP enabled we 67
don't need to add storage or tags but we need to configure a security group so 68
obviously we need double three eight nine for RDP connection to a Windows 69
Server instance. So that will be fine for us. So just review and launch and we'll 70
use the same key pair that we used before and we'll just wait for that to 71
boot up okay so our ec2 instance theory is up and running so let's just have a 72
look at that so what we can do now is that we can get our Windows password and 73
we do that by opening our keep part I'll keep here and then we get their 74
contents into this box here so let's open that up so there's our PEM file 75
that we downloaded previously and now we decrypt the password. So there's our 76
endpoint for this server and this is our username as an administrator and our 77
password there so we just need to go into an RDP client now on Mac the one 78
that I've found seems to be quite reliable is called Cord. So just go to 79
Google and typing cord RDP and you'll find the website for it. So just download 80
that and install it. So once you've install it you'll you'll get a screen 81
like this. So all you need to do is to just click on servers in this little 82
slide will come out and just add the server information. So I'm just going to 83
give it a name ec2 now the address will be the end point which you see them now 84
public dns endpoint so just copy that and bring that over 85
and our username and password 86
okay I mean just say that task squared there so we need to do now just close 87
out of that form and that should be all ready to go so we just double click on 88
this instance that we've quite all this server that we've just created that will 89
connect us straight in and there we go so it's connected and it will start to 90
do its business and we should get a user interface for our Microsoft server 91
okay so that you can see so we've connected in with we've got our user 92
interface for our server and everything's fine so that brings us to 93
the end of this lecture and I'll look forward to seeing you in the next ones