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.

1 REPLY 1

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