Support Questions

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

recover username and password from services installed

avatar
New Contributor

Hi,

I am using hadoop hortonworks hdp 3.0.1.0 and I have installed services such as hdfs, yarn, mapreduce2, tez, spark2, hive, hbase, sqoop, zookeeper, kafka, etc.

 

The problem i face now is for all this services that has been installed, I've actually forgotten the username and password for each of this service and the reason being I post this question is because I need to update a listing and keep in a secure manner to allow for future reference.

 

Is there a way to check how can this username and password be located in the server?

 

Thanks.

6 REPLIES 6

avatar
Master Mentor

@Mighty Mike

Normally you don't need to remember the passwords for these service users if you have root access or you are included in the sudoers files then you can switch to a user (su) using the below methods

su - {username} sets up the shell environment as if it were a clean login as the specified user, it accesses and uses specified users environment variables,

su {username} just starts a shell with current environment settings for the specified user.

If the username is not specified with su and su -, the root account is implied as default.

To check the usernames you run

cat /etc/passwd

Sample output

livy:x:1013:1007::/home/livy:/bin/bash
spark:x:1014:1007::/home/spark:/bin/bash
ambari-qa:x:1015:1007::/home/ambari-qa:/bin/bash
kafka:x:1016:1007::/home/kafka:/bin/bash
hdfs:x:1017:1007::/home/hdfs:/bin/bash
sqoop:x:1018:1007::/home/sqoop:/bin/bash
yarn:x:1019:1007::/home/yarn:/bin/bash


The encrypted passwords and other information such as password expiry information (the password aging information) are stored in /etc/shadow file. All fields are separated by a colon (:) symbol. It contains one entry per line for each user listed in /etc/passwd

Sample output

livy:!!:17900:0:99999:7:::
spark:!!:17900:0:99999:7:::
ambari-qa:!!:17900:0:99999:7:::
kafka:!!:17900:0:99999:7:::
hdfs:!!:17900:0:99999:7:::
sqoop:!!:17900:0:99999:7:::
yarn:!!:17900:0:99999:7:::
mapred:!!:17900:0:99999:7:::
hbase:!!:17900:0:99999:7:::
knox:!!:17900:0:99999:7:::

Hope that helps

avatar
New Contributor

I forgot my sqoop username. I am unable to use sqoop import or export because of this. How can we retrieve the username or reset the username. Appreciate your help.

avatar
New Contributor

anyways i solved the issue by setting up a new user id and password to access mysql from sqoop using the following command.

 

(1.) Log into MySQL as root 

mysql -u root -p

 

(2)

mysql> grant all privileges on *.* to 'testuser'@'%' identified by 'testpassword'

 

and it all worked fine. Thank you

avatar
Master Mentor

@stalsams 

If you have the root access just  switch to user sqoop as root user

# su - sqoop
$ id
uid=1020(sqoop) gid=1007(hadoop) groups=1007(hadoop)

 

Now you should be able to execute all sqoop commands with no need for a password

 

 

avatar
New Contributor

HI Shelton,

 

Is it possible to  reset passwords for all Hadoop accounts(hdfs, oozie etc). 

avatar
Expert Contributor

hdfs,yarn,hive etc are system users, they will not have any passwords by default, however you can su from root. If you really want set passwords anyway then $ passwd hdfs command will prompt you to set a new password but i don't see a reason why anyone want to do that for system users. 

Em Jay