# Unauthorized access using Java api

**URL:** <https://forum.opennebula.io/t/unauthorized-access-using-java-api/4145>\
**Category:** Integration Support\
**Created:** [April 15, 2017, 9:47pm UTC](https://forum.opennebula.io/t/unauthorized-access-using-java-api/4145 "2017-04-15T21:47:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Amaobi\_Victor](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/amaobi_victor/32/6564_2.png) [@Amaobi\_Victor](https://forum.opennebula.io/u/Amaobi_Victor)\
**Post date:** [April 15, 2017, 9:47pm UTC](https://forum.opennebula.io/t/unauthorized-access-using-java-api/4145/1 "2017-04-15T21:47:15Z")

</div>

Good Day. I tried to connect my java code on netbeans using the opennebula api. My session was onadmin:opennebula ,id was 0,and address was localhost:9869?rpc2. 9869 is the port my vm is listening from. Still it throws unauthorized. Please I need help. Thanks in advanced

---

<div class="post-metadata">

**Author:** ![juanmont](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@juanmont](https://forum.opennebula.io/u/juanmont)\
**Post date:** [April 25, 2017, 10:12am UTC](https://forum.opennebula.io/t/unauthorized-access-using-java-api/4145/2 "2017-04-25T10:12:36Z")

</div>

Have you done the creation of the public and private key? If you have not done so, you must create it and add it to a file called authorized\_keys

---

<div class="post-metadata">

**Author:** ![Amaobi\_Victor](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/amaobi_victor/32/6564_2.png) [@Amaobi\_Victor](https://forum.opennebula.io/u/Amaobi_Victor)\
**Post date:** [April 28, 2017, 12:14pm UTC](https://forum.opennebula.io/t/unauthorized-access-using-java-api/4145/3 "2017-04-28T12:14:04Z")

</div>

I will try that thanks. Just one more question, can I store a file e.g a doc file in a vm and retrieve it programmatically using one command. I’m actually working on a project and the deadline is coming soon. Thanks
