One_auth file is not present in opennebula

Yes I have executed sudo su - -c ‘chown -R oneadmin.oneadmin /var/lib/one/’ command under neha. But when I logged in as oneadmin and issued command sudo su - oneadmin -c ‘echo “oneadmin:1234” > /var/lib/one/.one/one_auth’ I got the same error as given below:

Sorry, user oneadmin is not allowed to execute ‘/bin/su - oneadmin -c echo “oneadmin:1234” > /var/lib/one/.one/one_auth’ as root on neha-HP-Compaq-8100-Elite-CMT-PC.

The output is attached.

I think some issues have been resolved. Previously when I issued oneuser show command as oneadmin I got below output.

/usr/lib/one/ruby/opennebula/client.rb:130:in initialize': ONE_AUTH file not present (RuntimeError) from /usr/lib/one/ruby/cli/one_helper.rb:373:innew’
from /usr/lib/one/ruby/cli/one_helper.rb:373:in get_client' from /usr/lib/one/ruby/cli/one_helper.rb:431:inset_client’
from /usr/bin/oneuser:43:in block (2 levels) in <main>' from /usr/lib/one/ruby/cli/command_parser.rb:445:inrun’
from /usr/lib/one/ruby/cli/command_parser.rb:76:in initialize' from /usr/bin/oneuser:36:innew’
from /usr/bin/oneuser:36:in `’

This time when I issued oneuser show command under oneadmin I got

Failed to open TCP connection to localhost:2633 (Connection refused - connect(2) for “localhost” port 2633)

Do I need to change iptable to open the TCP port 2633?

When I issued below command as oneadmin

oneadmin@neha-HP-Compaq-8100-Elite-CMT-PC:~$ cat /var/lib/one/.one/one_auth

I got oneadmin:1234 as output. But when a su command is issued under oneadmin I got

su: Authentication failure
error. Why the password is not working?

You should not execute sudo su - oneadmin commands while being oneadmin user already.
In order to diagnose why services are not running you need to revert back to neha user, and:

[neha@neha-HP-Compaq-8100-Elite-CMT-PC ~]$ sudo su - -c ‘systemctl status opennebula’
[neha@neha-HP-Compaq-8100-Elite-CMT-PC ~]$ sudo su - -c ‘systemctl restart opennebula’

Try to follow a sudo/su tutorial, like this one https://www.linux.com/blog/how-use-sudo-and-su-commands-linux-introduction

The output of sudo su - -c ‘systemctl status opennebula’ is attached.

sudo -s
cd /var/lib/one/.one
echo “oneadmin:password” > ./one_auth
systemctl restart opennebula

Hi Антон Зубков,
Thank you for the reply. Under what user do I need to execute these commands, neha or oneadmin?

Based on the previous comments suggested by Bogdan Stoica, Marcindulak, and Антон Зубков
1d, the following previous issues have been resolved:

  1. Now one_auth file is present, and
  2. I am able to access that file.

It is hard to understand that when I issued cat /var/lib/one/.one/one_auth under oneadmin, it is showing userid and password (onedmin:1234). But when I applied su command to get the root privileges and enter 1234 as password, Authentication failure encountered. Please anyone shade some light on this issue. Terminal output file is attached.

see my post and try

I have to issue this command under root systemctl restart opennebula. I got authentication failure as shown in above post.

Hi Антон Зубков,
I have executed the commands given in your post. It works fine. When I executed oneuser show command as oneadmin I got (Failed to open TCP connection to localhost:2633 (Connection refused - connect(2) for “localhost” port 2633)) output. Please let me know how to resolve this.

Referring the document
http://docs.opennebula.org/5.0/deployment/opennebula_installation/frontend_installation.html
I opened oned.log file but the file is blank this time. Previously when I opened it was not blank.

/var/lib/one/.one/one_auth has nothing to do with the authentication of the oneadmin unix user (see How To Use passwd and adduser to Manage Passwords on a Linux VPS | DigitalOcean).
Anyway, by the su command you are trying to become root.
/var/lib/one/.one/one_auth are the credentials for accessing the sunstone web interface as oneadmin opennebula user.

Let’s assume the problem with one_auth file maybe is possibly solved, and you are facing now https://forum.opennebula.io/t/failed-to-open-tcp-connection-to-localhost-2633-connection-refused-connect-2-for-localhost-port-2633 - please continue the discussion about 2633 there.