Link to home
Start Free TrialLog in
Avatar of cyimxtck
cyimxtckFlag for United States of America

asked on

Red Hat 7 Linux on Azure cannot run a command as root

[database]$ ls ru*

runInstaller

[database]$ sudo ./runInstaller

sudo: ./runInstaller: command not found

[database]$ ./runInstaller

-bash: ./runInstaller: Permission denied

[database]$


You can clearly see this file is there but it doesn't work?  Please let me understand what is happening here by folks that are well versed in this.  We just purchased an Oracle database and cannot install it on Azure....
Avatar of rindi
rindi
Flag of Switzerland image

Sudo probably isn't installed. As far as I know i doesn't get installed by default on RH.
Sudo does get installed by default.  Check the permissions on the script and make sure that it is, at a minimum, -rwxr-xr-x
Avatar of cyimxtck

ASKER

-rw-rw-r--. 1 database 8533 Jul  6  2015 runInstaller
[database]$

(sorry I am new to Linux)

There is not an execute here of course just read and write but couldn't a root user run that?  I am not sure what the fix is here?  Some CHMOD variation?
[database]$ sudo ./runInstaller
[sudo] password for xxx:
./runInstaller: line 249: /home/......../database/install/.oui: Permission denied
[database]$


above is the error now....here is what I ran:

[database]$ ls -l run*
-rw-rw-r--.  1 database 8533 Jul  6  2015 runInstaller

[database]$ chmod go+x runInstaller
[database]$ ls -l run*


-rw-rwxr-x.  1 database 8533 Jul  6  2015 runInstaller

gosh this seems complicated no?  LOL
sudo chmod 755 runinstaller
[database]$ sudo chmod 755 runInstaller
[sudo] password for database:
[database]$ ls -l run*
-rwxr-xr-x. 1 database 8533 Jul  6  2015 runInstaller
[database]$ sudo ./runInstaller
./runInstaller: line 249: /home/....../database/install/.oui: Permission denied
[database]$
Is there a way to give a privilege to an entire directory?
I am asking  (and maybe this is complete wrong lol) because it is looking in the install directory as it says in the above error

./runInstaller: line 249: /home/....../database/install/.oui: Permission denied
[database]$

[install]$ ls -l
total 248
-rw-rw-r--. 1 install     28 Jul  6  2015 addLangs.sh
-rw-rw-r--. 1 install    275 May 23  2014 attachHome.sh
-rw-rw-r--. 1 install   7499 May 23  2014 clusterparam.ini
-rw-rw-r--. 1 install    181 May 23  2014 detachHome.sh
drwxrwxr-x. 2 install   4096 Jul  6  2015 images
-rw-rw-r--. 1 install  65053 Jul  6  2015 lsnodes
-rw-rw-r--. 1 install   2121 Jul  6  2015 oraparam.ini
-rw-rw-r--. 1 install   2097 Jul  6  2015 oraparam.ini.deinstall
drwxrwxr-x. 2 install   4096 Jul  6  2015 resource
-rw-rw-r--. 1 install    107 May 23  2014 runInstaller.sh
-rw-rw-r--. 1 install 145976 May 23  2014 unzip
[ install]$
ASKER CERTIFIED SOLUTION
Avatar of Jan Bacher
Jan Bacher
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
[install]$ sudo ./runInstaller
[install]$ sudo ./runInstaller
[sudo] password for eDS_Master_DB:
sudo: ./runInstaller: command not found
[install]$
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I will try this after we get back from lunch.  thanks for all your help so far
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks for the input so far but nothing is working...

Can I login as root?  Not sure but it doesn't seem like Azure plays nice and lets that happen?  When I try to run a command I am prompted for the password and supply it (sorry I don't understand why this is so difficult to install a database)



[xxxxxx@xxxxxxx ~]$ visudo
visudo: /etc/sudoers: Permission denied
visudo: /etc/sudoers: Permission denied

ok....there is only one account here and I created the VM slice so Azure is precluding me from something?  This is Red Hat Enterprise 7 if that helps

try going to the directory and running it:

[xxxxxx@xxxxxx database]$ su
Password:
su: Authentication failure
[xxxxxx@xxxxxx database]$

I know it is the right password...

[xxxxxx@xxxxxx database]$ ls -l runInstaller
-rwxr-xr-x. 1 xxxxxx xxxxxx 8533 Jul  6  2015 runInstaller
[xxxxxx@xxxxxx database]$

There has to be a way to accomplish this task as I am not the only person running Oracle on Azure but it sure seems tricky to say the least.

Any ideas?

Please let me know.

Thanks,

B
Reading through the solutions posted so far you should have been able to run it.

I'd try contacting the Microsoft/Azure people and ask them.
./runInstaller: line 249: /home/....../database/install/.oui: Permission denied
[database]$

this is as close as I have come....it it telling me line 249 of .oui so there has to be another issue with permissions?

Trying to solve this today and have it running so tomorrow a full work day can be achieved (we have a ton of stuff to migrate)
https://docs.microsoft.com/en-us/azure/virtual-machines/virtual-machines-linux-use-root-privileges

that is the article that we are trying to follow along with but something is a miss here...
By default, the root user is disabled on Linux virtual machines in Azure. Users can run commands with elevated privileges by using the sudo command. However, the experience may vary depending on how the system was provisioned.

This is the comment that makes it difficult in the Azure platform....so we have to finagle around what they are saying here (although I am very green in Linux)
However, the experience may vary depending on how the system was provisioned.

I think that could be the problem. Without knowing more it's possible they use a modified Red Hat that prevents su or sudo.

Seems weird though. You should be able to get root access.
Isn't Azure just the m$ HyperVisor in the cloud (Hyper-V), and you install the OS, whatever it is? If you install the OS you set it up however you want to. With root access and all. The HyperVisor doesn't control what you do within the VM's.
I was FINALLY able to run this...

chmod 755 -R ./

I am facing other issues now with swap space but that command recursively gave the access to get it to run.  The Oracle universal installer was instantiated with this command and after that the sudo .... commands work.

Thanks for all the help