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.
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?
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’
Based on the previous comments suggested by Bogdan Stoica, Marcindulak, and Антон Зубков
1d, the following previous issues have been resolved:
Now one_auth file is present, and
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.
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.
/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.