Can we configure ambari to non-root user in an existing cluster - hadoop2

I know to configure ambari for non root user while setting up a fresh cluster, But is it possible to do this in a existing cluster which is run by root.
Appriciate your help.

Yes, to do so run the ambari-server setup command again.
Customize user account for ambari-server daemon?, choose y.
Also, remember to provide the non root user to have sudo access. Just like following the steps for the first time, you have to configure the non root user for proper privileges.
Reference:
https://community.hortonworks.com/questions/138060/is-there-any-way-to-change-ambari-server-user-afte.html

Related

Google Cloud WordPress MySQL password change

I have just managed to get a WP instance up and running on a Google Cloud VM. All is good and it is running WP fine. I have managed to update the 'temporary' passwords as advised for root MySQL user and phpMyAdmin user.
However it also recommends updating the password for the MySQL wordpress user. I am not sure how to do this and can't find much useful info.
Help please.
Looks like you can change the passwords in the phpMyAdmin interfaces.
This stackoverflow post Talks about how to access the pypMyAdmin interface.
Copied below for posterity:
First off, when you deploy the one-click installation, you need to ensure you have 'install phpMyAdmin' checked - we will assume that was installed and you did not overwrite the phpMyAdmin default user & password after :)
Next, navigate to the Google Cloud Console and find your project where your WordPress installation is located. From the left side menu, open Compute Engine and on the VM instances tab, select your virtual machine.
Once you open that view, scroll down to the custom metadata section
and find the 'MYSQL_ROOT_PASSWORD' value. That is the password you
need to log into phpMyAdmin.
After you know that value, navigate to the external IP of your machine
and add /phpmyadmin after the IP (e.g. xxx.xxx.xxx.xxx/phpmyadmin).
The default user will be 'root' and then enter the corresponding value
from MYSQL_ROOT_PASSWORD in custom metadata. That should do the trick
and get you access into phpMyAdmin.
Once logged into phpMyAdmin, This post talks about navigating to the Users table and updating the password on the user record. They do note that if you're changing the root user's password:
At this point, your wordpress site will not be able to access the contents of the database until you have updated the password on your wp-config file. Let’s do that...
But it sounds like you have root taken care of so this might not be an issue.

How can I run brew as root?

I know this is a frequently asked question, but I am really struggling.
I have recently tried to install MySQL with Homebrew on my Mac OS El-Capitan. However, I have encountered some problems with it and I want to reinstall it. Yet whenever I try doing that it gives me:
Error: Permission denied # rb_sysopen - /usr/local/var/homebrew/locks/mysql.formula.lock
I tried to bypass this error by simply sorting the named files out manually in the root account, but there were way too many files.
So I tried uninstalling it with root, but it gave me this error:
Error: Running Homebrew as root is extremely dangerous and no longer supported.
As Homebrew does not drop privileges on installation you would be giving all
build scripts full access to your system.
I looked at many articles, including this link! Many of them suggested that I chown the /usr/local folder directly to my own user account with root, so I can run brew without any permission problems, but it is too dangerous.
I tried to run:
sudo chown root /usr/local/bin/brew
But this did not work as well.
Is there any ways I can bypass this error, and run brew as root?
Many of them suggested that I chown the /usr/local folder directly to my own user account with root, so I can run brew without any permission problems, but it is too dangerous.
chowning all of /usr/local/ is probably a bad idea because it's not entirely under Homebrew's control. But just /usr/local/var/homebrew/locks/mysql.formula.lock should be ok.
chown $USER /usr/local/var/homebrew/locks/mysql.formula.lock
And follow the advice of brew doctor.
tried to run: sudo chown root /usr/local/bin/brew But this did not work as well.
All this accomplished was to make the file /usr/local/bin/brew owned by root. It doesn't make it run as root. You should change it back to being owned by your user else you won't be able to upgrade brew.
To make it run as root you'd use setuid. Do not do this. It's inherently dangerous, and doubly so with your current understanding of permissions. Nothing personal, permissions take a while to get used to and appreciate.
Homebrew does not run as root to limit the damage possible by a malicious package or a simple mistake. By running as your user it can only damage what is accessible to your user. This walls off important things like system files. This is the purpose of the Unix permission system: to limit how much damage is possible. If you run brew as root all bets are off.
Furthermore, if /usr/local/var/homebrew/locks/mysql.formula.lock is owned by root that means MySQL ran as root. If you run MySQL as root and it is compromised your whole system is compromised. If you run MySQL as your user or a special limited mysql user, only your user files or mysql's own files can be compromised. Run it as proscribed by homebrew.
It's very much worth it to learn to run with as few permissions as possible.
Using brew as root is a bad idea due security reasons. Instead you can change the brew file ownership to the current logged in user. Type this single command:
sudo chown $USER /usr/local/bin/brew
i thought i would chime in to this conversation since it's one of the top hits on google still
To make it run as root you'd use setuid
i played with this today, this does not work since brew is a bash script, not an executable
One option that you have is to sudo touch /.dockerenv on linux: https://github.com/Homebrew/brew/blob/4eaaa867de30a1e09bfbf303f46493826dc746e7/Library/Homebrew/brew.sh#L182
You can also do this on macOS but it requires unsealing the root volume, which is considerably more work than what I was going to undertake today
My fix was to add a second test just like this one that whitelists brew info as a not-harmful command directly into brew.sh
i plan to submit this as an upstream patch

Missing sudo access in Google Compute Engine

In Google compute engine I do not have sudo ability on my VM.
According to the documentation and other threads on this topic, it should automatically be created when I SSH in from the Google Console. It worked this way for a week or two and now prompts for a password (I also rebuilt a vm that did this same thing a couple of weeks ago).
I have tried letting my keys expire, opening and closing a new session, and external ssh and they all display the same problem.
Here is a screenshot from a new browser instance:
You can try using “sudo -s” command from any user to directly switch to root and use sudo access. Also root password can be changed by using “passwd root” command after sudo access have been got.
That being said, the screen that you are getting is the lecture that is set to be displayed every time sudo is used. This can be changed in /etc/sudoers file by setting Defaults lecture=once as explained in this article. If the lecture is set to once, it will force the sudo command to show the prompt you are getting for the first time only.

Setting up new instance of MySQL what is Current Root Password?

I am new to MySQL and am setting up a new instance of MySQL using the Windows Installer and am being prompted for two passwords.
The Current Root Password and the MySQL Root Password.
Is there a standard Current Root Password for new installations?
What is the difference between the two passwords.
If you don't remember your current root password and want to install new instance of MySQL and you have applied other ways like "-init-file.txt", but still failed.
There is another solution which worked for me. Uninstalling MySQL from control panel didn't remove all files, it left some references in the system.
To delete MySQL files completely, open the folder path C:\Users\your pc name\AppData\Roaming and delete the MySQL folder.
Then remove one more reference which is in C:\ProgramData\MySQL, if not visible check your folder view options and uncheck "Don't show hidden files".
The last reference of MySQL exists in our system services:
Type "Services" in the search box of the taskbar. Find services related to MySQL and note them down. I have two in my case(MySQLRouter and MYSQL80).
Open the command prompt with administrator and type:
sc delete "ServiceName",
In my case:
sc delete MySQL80
sc delete MySQLRouter
Ensure all services related to MySQL are removed by using the above command. Restart your computer and install your MySQL instance with a new configuration.
The standard password for user root is simply: password
Each user had its own password. So a password must belong to a user. So the only difference of password are just what they contain.
root is AFAIK the only user created upon installation. Did you create a new user after installation?
issue:- new mysql installation steps asks for current root password when it ideally should be prompting set new password option.
solution :-Issue could be due to existence of a previous unsuccessful mysql installation, leaving behind contents even after uninstalling.(at c:mysql,c:/ program files/mysql,c:/program data/mysql )
In my case they required manual deletion;after which new installation of mysql went on smooth .
(had to msconfig too, to handle unending windows hanging sometime during the process.)
The community wiki has an excellent guide on the steps that one needs to follow.
Please note that uninstalling MySQL from the installer gives the option to remove all data as well, which by default is unselected.
Check the box and then uninstall MySQL.
After that, follow the guidelines in the community wiki.
Uninstall mysql all setup fully
Delete all files related to MySQL
From program files, program files x86:
C>username>appdata_>Roaming>mysql
After that install mysql
Try switching to root user using su or sudo -i, if possible, then use password as password.

Running MySQL with user=root

I'm setting up a lamp server on my android phone, and i didn't managed to get mysql working with the default settings. i had to change the user to root in the my.cnf.
So i'm curious about the dangers of running mysql under the root user.
running MySQL as root, means everything the server does is also done as root (obvious). Especially if you happen to make a mistake, this can cause problems:
if you mis configure the mysql logfile to /etc/passwd, then that important file will probably be overwritten (a normal user cant do that).
root usually as some amount of disk system reserved (per filesystem), thus you can easier make the partition full as root.
code injection: if you have scripts running (for backup of the now root owned files) than you need higher privileges there, and again any mistake might have a bigger impact.
It is ok to login as a root user. However, use it to create new users with limited privileges on objects (tables, indexes, databases, etc) so that those users can't break anything other than what they're allowed to :)
Once the new users are created logout as root and login with those new users. I see you're using linux, so the idea of root user applies to MySQL in a similar way as in linux.
You can check the official documentation about this: Adding users and granting privileges