Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

recover username and password from services installed

Highlighted

recover username and password from services installed

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.

4 REPLIES 4
Highlighted

Re: recover username and password from services installed

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

Highlighted

Re: recover username and password from services installed

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.

Highlighted

Re: recover username and password from services installed

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

Re: recover username and password from services installed

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

 

 

Don't have an account?
Coming from Hortonworks? Activate your account here