# Access to ec2 host vm post-launch using id\_rsa

**URL:** <https://forums.suse.com/t/access-to-ec2-host-vm-post-launch-using-id-rsa/2281>\
**Category:** Rancher 1.x\
**Created:** [April 2, 2016, 4:57am UTC](https://forums.suse.com/t/access-to-ec2-host-vm-post-launch-using-id-rsa/2281 "2016-04-02T04:57:50Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![kneu](https://avatars.discourse-cdn.com/v4/letter/k/8edcca/32.png) [@kneu](https://forums.suse.com/u/kneu)\
**Post date:** [April 2, 2016, 4:57am UTC](https://forums.suse.com/t/access-to-ec2-host-vm-post-launch-using-id-rsa/2281/1 "2016-04-02T04:57:50Z")

</div>

I am trying to access an ec2 instance launched as host through the rancher ui.

This post highlights the problem I’m running into:

> [@How to SSH into RancherOS instances created in AWS via the UI](http://forums.suse.com/t/how-to-ssh-into-rancheros-instances-created-in-aws-via-the-ui/131):
>
> I created a couple host instances in EC2 using the UI, and I’d like to SSH into them. Looking at the instances in EC2, each of the hosts were created with their own key pair (named after the host name). However, I don’t have those keys to ssh into them. I’m not sure where to find those keys or where/how I can connect to them. I tried on the host server which is running rancher/server I tried from the rancher/server container via docker exec I guess I must be missing something obvious? Cou…

The explanation makes sense. However, I’m still not able to connect. I’ve tried multiple keys and the id\_rsa approach.

When using the id\_rsa approach, is it still required that chmod 600 be used as well as listing the full path to the id\_rsa?

---

<div class="post-metadata">

**Author:** ![denise](https://avatars.discourse-cdn.com/v4/letter/d/82dd89/32.png) [@denise](https://forums.suse.com/u/denise)\
**Post date:** [April 2, 2016, 5:46am UTC](https://forums.suse.com/t/access-to-ec2-host-vm-post-launch-using-id-rsa/2281/2 "2016-04-02T05:46:58Z")

</div>

[http://docs.rancher.com/rancher/rancher-ui/infrastructure/hosts/#accessing-hosts-from-the-cloud-providers](http://docs.rancher.com/rancher/rancher-ui/infrastructure/hosts/#accessing-hosts-from-the-cloud-providers)

You need to download the machine config which has the specific id\_rsa for the machine that you want to access.

Wherever you launch the command should have access to the id\_rsa. I haven’t tested in awhile, but I don’t ever remember doing a chmod for it.

What EC2 OS did you select? Sometimes you need to use different users based on your OS. For example, RancherOS would be `ssh -i id_rsa rancher@<ip_of_host>`, Ubuntu is `ssh -i id_rsa ubuntu@<ip_of_host>`.

---

<div class="post-metadata">

**Author:** ![vincent](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/vincent/32/7156_2.png) [@vincent](https://forums.suse.com/u/vincent)\
**Post date:** [April 2, 2016, 5:52am UTC](https://forums.suse.com/t/access-to-ec2-host-vm-post-launch-using-id-rsa/2281/3 "2016-04-02T05:52:13Z")

</div>

You need the right username too… If you didn’t specifically set an AMI then it will be an Ubuntu image and either `root` or `ubuntu` (Not `rancher`).

---

<div class="post-metadata">

**Author:** ![kneu](https://avatars.discourse-cdn.com/v4/letter/k/8edcca/32.png) [@kneu](https://forums.suse.com/u/kneu)\
**Post date:** [April 2, 2016, 5:56am UTC](https://forums.suse.com/t/access-to-ec2-host-vm-post-launch-using-id-rsa/2281/4 "2016-04-02T05:56:00Z")

</div>

I am using ubuntu OS, and i downloaded the config.

I tried the following:

$ ssh -i id\_rsa [ubuntu@ec2-54-152-228-146.compute-1.amazonaws.com](mailto:ubuntu@ec2-54-152-228-146.compute-1.amazonaws.com)

$ ssh -i id\_rsa [ubuntu@54.152.228.146](mailto:ubuntu@54.152.228.146)

$ ssh -i ~/full-file-path/id\_rsa [ubuntu@54.152.228.146](mailto:ubuntu@54.152.228.146)

none of these provided access to the instance.

---

<div class="post-metadata">

**Author:** ![denise](https://avatars.discourse-cdn.com/v4/letter/d/82dd89/32.png) [@denise](https://forums.suse.com/u/denise)\
**Post date:** [April 4, 2016, 6:48pm UTC](https://forums.suse.com/t/access-to-ec2-host-vm-post-launch-using-id-rsa/2281/5 "2016-04-04T18:48:33Z")

</div>

I just tested this with v1.0.0 and had no issues.

Do you have more than 1 host? Please make sure you are in the correct host’s folder. If you have navigate inside the folder of the host, then you should be able to do `ssh -i id_rsa ubuntu@54.152.228.146` and log into the machine.
