Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

I have successfully installed HDP and Ambari but I want to change ssh user. Now i do ssh via root but i want to change root to centos user.

avatar
Rising Star
 
1 ACCEPTED SOLUTION

avatar
Master Mentor

@ANSARI FAHEEM AHMED


You will need to run the "ambari-server setup" command again and then you need to choose the "Customize user account for ambari-server daemon" prompt, to proceed as root. If you want to create a different user to run the Ambari Server, or to assign a previously created user, select y at the Customize user account for ambari-server daemon prompt, then provide a user name.

https://docs.hortonworks.com/HDPDocuments/Ambari-2.5.1.0/bk_ambari-installation/content/set_up_the_a...

Example:

# sudo ambari-server setup
.
Customize user account for ambari-server daemon [y/n] (n)? y  
Enter user account for ambari-server daemon (root): ambari 
.

.

If you are using views then you will need to also change the proxy user setting to the new user name:

Server: https://docs.hortonworks.com/HDPDocuments/Ambari-2.5.1.0/bk_ambari-security/content/how_to_configure...

Agent: https://docs.hortonworks.com/HDPDocuments/Ambari-2.5.1.0/bk_ambari-security/content/how_to_configure...

.

Also if there are some directories that has the root:root permissions then you will need to change them accordingly.

Example:

# ls -l /var/run/ambari-server 
sudo chown -R ambari   root  /var/run/ambari-server 

# ls -l /var/run/ambari-agent 
sudo chown -R ambari   root  /var/run/ambari-agent 

.

View solution in original post

4 REPLIES 4

avatar
Master Mentor

@ANSARI FAHEEM AHMED


You will need to run the "ambari-server setup" command again and then you need to choose the "Customize user account for ambari-server daemon" prompt, to proceed as root. If you want to create a different user to run the Ambari Server, or to assign a previously created user, select y at the Customize user account for ambari-server daemon prompt, then provide a user name.

https://docs.hortonworks.com/HDPDocuments/Ambari-2.5.1.0/bk_ambari-installation/content/set_up_the_a...

Example:

# sudo ambari-server setup
.
Customize user account for ambari-server daemon [y/n] (n)? y  
Enter user account for ambari-server daemon (root): ambari 
.

.

If you are using views then you will need to also change the proxy user setting to the new user name:

Server: https://docs.hortonworks.com/HDPDocuments/Ambari-2.5.1.0/bk_ambari-security/content/how_to_configure...

Agent: https://docs.hortonworks.com/HDPDocuments/Ambari-2.5.1.0/bk_ambari-security/content/how_to_configure...

.

Also if there are some directories that has the root:root permissions then you will need to change them accordingly.

Example:

# ls -l /var/run/ambari-server 
sudo chown -R ambari   root  /var/run/ambari-server 

# ls -l /var/run/ambari-agent 
sudo chown -R ambari   root  /var/run/ambari-agent 

.

avatar
Rising Star

Thanks for the reply, But I want to change ssh session. I am configured ssh with root account but now i have to change to Centos account. It's possible to change or not?

avatar
Master Mentor

@ANSARI FAHEEM AHMED

Here is a smooth method of giving Centos 7 user root privileges link

avatar
Rising Star

Thanks for the reply, But I want to change ssh session. I am configured ssh with root account but now i have to change to Centos account. It's possible to change or not?