# Trouble accessing LXC container

**URL:** <https://forum.ansible.com/t/trouble-accessing-lxc-container/13779>\
**Category:** Ansible Project\
**Created:** [October 26, 2013, 8:13pm UTC](https://forum.ansible.com/t/trouble-accessing-lxc-container/13779 "2013-10-26T20:13:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jay\_Pipes](https://avatars.discourse-cdn.com/v4/letter/j/c77e96/32.png) [@Jay\_Pipes](https://forum.ansible.com/u/Jay_Pipes)\
**Post date:** [October 26, 2013, 8:13pm UTC](https://forum.ansible.com/t/trouble-accessing-lxc-container/13779/1 "2013-10-26T20:13:58Z")

</div>

Hi all,

I’ve got a couple LXC containers running that I’m trying to experiment with Ansible on:

$ sudo lxc-ls --fancy  
NAME STATE IPV4 IPV6 AUTOSTART

---

<div class="post-metadata">

**Author:** ![James\_Cammarata1](https://avatars.discourse-cdn.com/v4/letter/j/d26b3c/32.png) [@James\_Cammarata1](https://forum.ansible.com/u/James_Cammarata1)\
**Post date:** [October 28, 2013, 2:39am UTC](https://forum.ansible.com/t/trouble-accessing-lxc-container/13779/2 "2013-10-28T02:39:15Z")

</div>

If you don’t have a SSH key setup, you’ll need to use --ask-pass (and have the askpass program installed) in order for it to prompt you for the password. You could write a play that deployed your key that way.

---

<div class="post-metadata">

**Author:** ![Kapil\_Thangavelu](https://avatars.discourse-cdn.com/v4/letter/k/dbc845/32.png) [@Kapil\_Thangavelu](https://forum.ansible.com/u/Kapil_Thangavelu)\
**Post date:** [October 28, 2013, 2:41pm UTC](https://forum.ansible.com/t/trouble-accessing-lxc-container/13779/3 "2013-10-28T14:41:17Z")

</div>

When creating a container (lxc-create) if your using the ubuntu or ubuntu-cloud template… you can pass in an -S to pass a public key for future access. The ubuntu-cloud template also has support for -S on lxc-clone.

---

<div class="post-metadata">

**Author:** ![Jay\_Pipes](https://avatars.discourse-cdn.com/v4/letter/j/c77e96/32.png) [@Jay\_Pipes](https://forum.ansible.com/u/Jay_Pipes)\
**Post date:** [October 31, 2013, 4:29am UTC](https://forum.ansible.com/t/trouble-accessing-lxc-container/13779/4 "2013-10-31T04:29:40Z")

</div>

Thanks Kapil and James, you got me in the right direction 🙂 Problems solved!

Best,  
-jay
