# Please explain ec2\_instance volumes config

**URL:** <https://forum.ansible.com/t/please-explain-ec2-instance-volumes-config/28317>\
**Category:** Ansible Project\
**Created:** [August 12, 2018, 12:57am UTC](https://forum.ansible.com/t/please-explain-ec2-instance-volumes-config/28317 "2018-08-12T00:57:46Z")\
**Posts on this page:** 17\
**Page:** 2

<div class="post-metadata">

**Author:** ![Kiran\_Sonawane](https://avatars.discourse-cdn.com/v4/letter/k/ba9def/32.png) [@Kiran\_Sonawane](https://forum.ansible.com/u/Kiran_Sonawane)\
**Post date:** [August 13, 2018, 9:54am UTC](https://forum.ansible.com/t/please-explain-ec2-instance-volumes-config/28317/21 "2018-08-13T09:54:08Z")

</div>

should I mention any path for IdentityFile ?

---

<div class="post-metadata">

**Author:** ![Karl\_Auer](https://avatars.discourse-cdn.com/v4/letter/k/cc9497/32.png) [@Karl\_Auer](https://forum.ansible.com/u/Karl_Auer)\
**Post date:** [August 13, 2018, 10:11am UTC](https://forum.ansible.com/t/please-explain-ec2-instance-volumes-config/28317/22 "2018-08-13T10:11:07Z")

</div>

Test the connection first using this command:

ssh -i ~/.ssh/keyfile.pem [ubuntu@18.191.217.98](mailto:ubuntu@18.191.217.98)

---

<div class="post-metadata">

**Author:** ![Kiran\_Sonawane](https://avatars.discourse-cdn.com/v4/letter/k/ba9def/32.png) [@Kiran\_Sonawane](https://forum.ansible.com/u/Kiran_Sonawane)\
**Post date:** [August 13, 2018, 10:25am UTC](https://forum.ansible.com/t/please-explain-ec2-instance-volumes-config/28317/23 "2018-08-13T10:25:47Z")

</div>

I just tried what you said and it just forced log out of Superuser then all the copied .pem file and id\_rsa.pub key all are gone It’s been a week I’m only trying to ssh from one instance to another now its seems it’s not that worth of time. I’m sanding you screen shot. thanx

> **(attachments)**
>
> ![Capture2.PNG](https://us1.discourse-cdn.com/ansible/original/2X/5/5d2189ee13482730959af5ddf42a46986c197f54.png)  
> ![Capture1.PNG](https://us1.discourse-cdn.com/ansible/original/2X/f/f5e767a1dd8346177aeea793a1a4ae95ebaded3e.png)

---

<div class="post-metadata">

**Author:** ![Karl\_Auer](https://avatars.discourse-cdn.com/v4/letter/k/cc9497/32.png) [@Karl\_Auer](https://forum.ansible.com/u/Karl_Auer)\
**Post date:** [August 13, 2018, 10:48am UTC](https://forum.ansible.com/t/please-explain-ec2-instance-volumes-config/28317/24 "2018-08-13T10:48:35Z")

</div>

Hullo again.

Configuration files need to be copied exactly and accurately. Look at the config file you sent - it does not match the formatting I sent, unless email screwed it up. Each line - Host, Hostname, User and IdentityFile, must be on a separate line. The value for each keyword should be on the same line as the keyword, separated from it by a space. It looks to me as if the IdentityFile line has a line break in it - fix that. Also - just for neatness, not sure it’s actually necessary - indent the three lines after the Host line.

Now on to your login: It looks to me as if it worked. You have successfully logged in to 18.222.132.35.

I suggest you correct the permissions on Insta\_1.pem (use 600 instead of 400, but as you can see it works either way with sudo, because root can read anything).

What files are you saying are “all gone”? Gone from where?

Regards, K.

---

<div class="post-metadata">

**Author:** ![Karl\_Auer](https://avatars.discourse-cdn.com/v4/letter/k/cc9497/32.png) [@Karl\_Auer](https://forum.ansible.com/u/Karl_Auer)\
**Post date:** [August 13, 2018, 11:03am UTC](https://forum.ansible.com/t/please-explain-ec2-instance-volumes-config/28317/25 "2018-08-13T11:03:15Z")

</div>

I don’t think it “logged you out of superuser” - I think it logged you into the remote system 🙂

---

<div class="post-metadata">

**Author:** ![Kiran\_Sonawane](https://avatars.discourse-cdn.com/v4/letter/k/ba9def/32.png) [@Kiran\_Sonawane](https://forum.ansible.com/u/Kiran_Sonawane)\
**Post date:** [August 13, 2018, 11:30am UTC](https://forum.ansible.com/t/please-explain-ec2-instance-volumes-config/28317/26 "2018-08-13T11:30:57Z")

</div>

I already did that all changes, made the path on same line. Then I changed permissions to from 777 to 666  
Then I again changed to 400. Nothing worked. I just don’t understand what’s happening?  
All the files from /.ssh are gone. Id\_rsa, Id\_rsa.pub, my .pem file config file all are not there when I automatically logged out of root.

---

<div class="post-metadata">

**Author:** ![Karl\_Auer](https://avatars.discourse-cdn.com/v4/letter/k/cc9497/32.png) [@Karl\_Auer](https://forum.ansible.com/u/Karl_Auer)\
**Post date:** [August 13, 2018, 11:46am UTC](https://forum.ansible.com/t/please-explain-ec2-instance-volumes-config/28317/27 "2018-08-13T11:46:15Z")

</div>

Look carefully at the pictures you sent me. They show, very clearly, that you have successfully logged into 18.222.132.35.

The reason you think things are “gone” is because those things exist on your source system, not on your target system.

From the command prompt “ubuntu@ip-172-31-23-215” type “exit” and press return. You will find yourself back on your source system, and the “missing” items will be there. They never left - you did 🙂

Regards, K.

---

<div class="post-metadata">

**Author:** ![Kiran\_Sonawane](https://avatars.discourse-cdn.com/v4/letter/k/ba9def/32.png) [@Kiran\_Sonawane](https://forum.ansible.com/u/Kiran_Sonawane)\
**Post date:** [August 13, 2018, 1:43pm UTC](https://forum.ansible.com/t/please-explain-ec2-instance-volumes-config/28317/28 "2018-08-13T13:43:19Z")

</div>

I mean i was loged out as root user and become normal use. I didn’t really go to my remote machine. but I’m sending you screen shots of my cmd where i changed Insta\_1.pen to 600 then try to shh -i ~/.ssh/Insta\_1.pem ubuntu@publicIP and it did the same thing as last time.  
Logged out of super user and vanished my .pen file.  
I really have no idea what’s happening. please tell me what exactly happening, i’m doing something wrong ?

Thanx You’re really helping me so much.

---

<div class="post-metadata">

**Author:** ![Kiran\_Sonawane](https://avatars.discourse-cdn.com/v4/letter/k/ba9def/32.png) [@Kiran\_Sonawane](https://forum.ansible.com/u/Kiran_Sonawane)\
**Post date:** [August 13, 2018, 1:51pm UTC](https://forum.ansible.com/t/please-explain-ec2-instance-volumes-config/28317/29 "2018-08-13T13:51:29Z")

</div>

I’m Constantly getting this window. What is this ? sending a new screen shot

---

<div class="post-metadata">

**Author:** ![Kiran\_Sonawane](https://avatars.discourse-cdn.com/v4/letter/k/ba9def/32.png) [@Kiran\_Sonawane](https://forum.ansible.com/u/Kiran_Sonawane)\
**Post date:** [August 13, 2018, 1:58pm UTC](https://forum.ansible.com/t/please-explain-ec2-instance-volumes-config/28317/30 "2018-08-13T13:58:06Z")

</div>

I made Changes in my sshd\_config file like yes to passwordauthentication and bunch of as shown on youtube. is that problem ? because it won’t be here it’ll give permission errors then .

---

<div class="post-metadata">

**Author:** ![Kiran\_Sonawane](https://avatars.discourse-cdn.com/v4/letter/k/ba9def/32.png) [@Kiran\_Sonawane](https://forum.ansible.com/u/Kiran_Sonawane)\
**Post date:** [August 13, 2018, 2:06pm UTC](https://forum.ansible.com/t/please-explain-ec2-instance-volumes-config/28317/31 "2018-08-13T14:06:36Z")

</div>

Even now I directly tried without being an root user but it still shows the same thing . my last logged in details. but before that it may be connect to the client since there were no errors shown. so now I’m completely confused and tried every combination in this week. but no idea what exactly is happening.

---

<div class="post-metadata">

**Author:** ![Kiran\_Sonawane](https://avatars.discourse-cdn.com/v4/letter/k/ba9def/32.png) [@Kiran\_Sonawane](https://forum.ansible.com/u/Kiran_Sonawane)\
**Post date:** [August 13, 2018, 2:07pm UTC](https://forum.ansible.com/t/please-explain-ec2-instance-volumes-config/28317/32 "2018-08-13T14:07:27Z")

</div>

sorry i forgot screen shot attachment

> **(attachments)**
>
> ![without being sudo (root) user it still shows the same result.PNG](https://us1.discourse-cdn.com/ansible/original/2X/4/462047bce748b277f19b7fe7dc5bda2087d71f72.png)

---

<div class="post-metadata">

**Author:** ![Karl\_Auer](https://avatars.discourse-cdn.com/v4/letter/k/cc9497/32.png) [@Karl\_Auer](https://forum.ansible.com/u/Karl_Auer)\
**Post date:** [August 13, 2018, 3:41pm UTC](https://forum.ansible.com/t/please-explain-ec2-instance-volumes-config/28317/33 "2018-08-13T15:41:55Z")

</div>

Please do this:

Use the AWS EC2 Console to find out the public and private addresses of the system you want to connect FROM. We will call this system “system A”. Please post those details here.

Use the AWS EC2 Console to find out the private and public addresses of the system you want to connect TO. We will call this system “system B”. Please post those details here.

Regards, K.

PS: You do not need PasswordAuthentication, and you should revert any changes you have made to ssh\_config or sshd\_config.

---

<div class="post-metadata">

**Author:** ![Kiran\_Sonawane](https://avatars.discourse-cdn.com/v4/letter/k/ba9def/32.png) [@Kiran\_Sonawane](https://forum.ansible.com/u/Kiran_Sonawane)\
**Post date:** [August 14, 2018, 5:26am UTC](https://forum.ansible.com/t/please-explain-ec2-instance-volumes-config/28317/34 "2018-08-14T05:26:12Z")

</div>

Good Morning Karl. I just tried Doing the same thing with newly created Instances but same error, you’re right though we don’t have to change anything in sshd\_config.

Now I’m sending you screen shots of Master and Client1 instances Public Private IP’s .

> **(attachments)**
>
> ![Client_IP.PNG](https://us1.discourse-cdn.com/ansible/original/2X/d/d896cbadc60e5350d2a3ff36fad9f13d56d6ebd5.png)  
> ![Master_IP.PNG](https://us1.discourse-cdn.com/ansible/original/2X/e/e141f8c7a3fe95f8c8aa17a8eb3d7ee763b525eb.png)  
> ![Same_Issue_New_day.PNG](https://us1.discourse-cdn.com/ansible/original/2X/a/af1de783f9fce70935b244593d83a991498543ff.png)

---

<div class="post-metadata">

**Author:** ![Karl\_Auer](https://avatars.discourse-cdn.com/v4/letter/k/cc9497/32.png) [@Karl\_Auer](https://forum.ansible.com/u/Karl_Auer)\
**Post date:** [August 14, 2018, 6:24am UTC](https://forum.ansible.com/t/please-explain-ec2-instance-volumes-config/28317/35 "2018-08-14T06:24:52Z")

</div>

So:

“System A” is the one you call “Master”, and has public IP 18.191.161.9. It has the private IP address 172.31.20.219.

“System B” is the one you call “Client”, and has the private IP address 172.31.24.31. I know this because before you changed the prompt to “Client@”, the prompt was “root@ip-172-31-24-31:~#”.

You were logged into System A, and you ran ssh to connect to 18.222.135.76. The next command prompt you saw was “ubuntu@ip-172-31-24-31:~$”. See above - that IP address, 172.31.24.31, is System B.

**In other words, you were on System A, ran ssh, and ended up logged into System B. Success!**

I do not understand what error you think you are seeing. This is how it is supposed to work.

Remember: You logged into System B as “ubuntu”, not “root”. So you were in a different home directory, with a different ~/.ssh directory.

Also remember that although you are connecting to a public address, in the AWS universe instances don’t know about their own public (or EIP) IPv4 addresses. That is why when you are logged in to AWS instances, you can see only their private addresses.

Regards, K.

PS: None of the steps you did on System B (“Client”) were needed.

---

<div class="post-metadata">

**Author:** ![Bruce\_Affonso](https://avatars.discourse-cdn.com/v4/letter/b/b2d939/32.png) [@Bruce\_Affonso](https://forum.ansible.com/u/Bruce_Affonso)\
**Post date:** [August 26, 2018, 5:42pm UTC](https://forum.ansible.com/t/please-explain-ec2-instance-volumes-config/28317/36 "2018-08-26T17:42:22Z")

</div>

I think this thread got derailed - so is there a way to configure volume with the ec2\_instance module?

It works with ec2 module but hoping to use the ec2\_instance module since it uses boto3 which I am told would help me workaround an issue I am having launching ec2 instances from a server with IAM role attached vs access/secret keys.

---

<div class="post-metadata">

**Author:** ![Badraj\_Angirekula](https://avatars.discourse-cdn.com/v4/letter/b/a4c791/32.png) [@Badraj\_Angirekula](https://forum.ansible.com/u/Badraj_Angirekula)\
**Post date:** [August 27, 2018, 9:26am UTC](https://forum.ansible.com/t/please-explain-ec2-instance-volumes-config/28317/37 "2018-08-27T09:26:58Z")

</div>

Hi all,  
please help me.

Build ec2 instances with attaching multiple tags names :-  
&nbsp;&nbsp;For example- I have launched one ec2 instance with tag name "websever1"  
the next builds of ec2 instances should start with tag name webserver2 ,  
webserver3 .... automatically.

Note: No two ec2 instances have same tag name.

[Previous page](https://forum.ansible.com/t/please-explain-ec2-instance-volumes-config/28317.md?page=1)
