Unauthorized access using Java api

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

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

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