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.

How to create user home directory [/user/${user_name}/] automatically in HDFS after user logs in to the cluster using AD/Kerberos

Solved Go to solution

How to create user home directory [/user/${user_name}/] automatically in HDFS after user logs in to the cluster using AD/Kerberos

New Contributor
 
1 ACCEPTED SOLUTION

Accepted Solutions

Re: How to create user home directory [/user/${user_name}/] automatically in HDFS after user logs in to the cluster using AD/Kerberos

Super Mentor

@D Giri

Please refer to the following doc:

Enable User Home Directory Creation:

https://docs.hortonworks.com/HDPDocuments/Ambari-2.5.0.3/bk_ambari-administration/content/create_use...

By editing the "/etc/ambari-server/conf/ambari-properties" and adding the following:

ambari.post.user.creation.hook=/var/lib/ambari-server/resources/scripts/post-user-creation-hook.sh

.

For kerberized environment you must modify the kinit file path in the default user creation hook script.

/var/lib/ambari-server/resources/scripts/post-user-creation-hook.sh

.

7 REPLIES 7

Re: How to create user home directory [/user/${user_name}/] automatically in HDFS after user logs in to the cluster using AD/Kerberos

Super Mentor

@D Giri

Please refer to the following doc:

Enable User Home Directory Creation:

https://docs.hortonworks.com/HDPDocuments/Ambari-2.5.0.3/bk_ambari-administration/content/create_use...

By editing the "/etc/ambari-server/conf/ambari-properties" and adding the following:

ambari.post.user.creation.hook=/var/lib/ambari-server/resources/scripts/post-user-creation-hook.sh

.

For kerberized environment you must modify the kinit file path in the default user creation hook script.

/var/lib/ambari-server/resources/scripts/post-user-creation-hook.sh

.

Re: How to create user home directory [/user/${user_name}/] automatically in HDFS after user logs in to the cluster using AD/Kerberos

New Contributor

Thanks Jay SenSharma for sharing the link.

Re: How to create user home directory [/user/${user_name}/] automatically in HDFS after user logs in to the cluster using AD/Kerberos

@Jay Kumar SenSharma

Hi Jay ,

if group is being sync with ambari from ldap in this case will the directory be created for the all the members in the group ?

Re: How to create user home directory [/user/${user_name}/] automatically in HDFS after user logs in to the cluster using AD/Kerberos

Super Collaborator

and don't forget to add:

ambari.post.user.creation.hook.enabled=true

to "/etc/ambari-server/conf/ambari-properties" as well !!

Re: How to create user home directory [/user/${user_name}/] automatically in HDFS after user logs in to the cluster using AD/Kerberos

New Contributor

Hello jay,

May i know how to know default kinit file location?

and

my cluster is kerberized can you tell me what was the parameter in the post-user-creation-hook.sh script specifies the kinit file path?

Regards,

Venkatesh.

Re: How to create user home directory [/user/${user_name}/] automatically in HDFS after user logs in to the cluster using AD/Kerberos

Super Collaborator

@Ramisetty Venkatesh

its easy, just execute

which kinit

on Nix and the output is what should go into the hook script part at:

echo "The cluster is secure, calling kinit ..."
  kinit_cmd="/usr/bin/kinit -kt $HDFS_KEYTAB $HDFS_PRINCIPAL"

But 9 times ou of 10 /usr/bin/kinit will be just fine

Re: How to create user home directory [/user/${user_name}/] automatically in HDFS after user logs in to the cluster using AD/Kerberos

New Contributor

Hello Jasper/Jay,

I have tried all the steps mentioned above. But user home directory was not getting created when user logs on to HDFS for first time.

The newly created user directories are getting created only after running LDAP Sync Script and followed by ambari server service restart.

We cannot perform Ambari server service restart every time when user gets created in environment. So please suggest When this hook script is getting called and executed?

and remedy for this issue.

Regards,

venkatesh.

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