Support Questions

Find answers, ask questions, and share your expertise

Setting a permission in hive databases.

avatar
Contributor

Hi,

I have 10 applications. Each application has its own databases in hive. Here i want to enable permissions, only the application users can access this application and other users cannot access this application. Like this we want to set permissions to other folders

Can someone help us how we can set a permission's in application wise.

4 REPLIES 4

avatar
Expert Contributor

You can do by as below.

1) Create the user at OS level and assign the group and owner to user.

2) Grant all permission to that user only in Hive as below.

Need to login with root use set role admin;

#hive

hive>set role admin; (admin role should have insert update and delete , which ever you want to give)

Hive>use database;

Hive>grant all on table table_name to role os_user_name with grant option;

By this "os_user_name" only can able to access, other wont able to see the tables.

It has worked me at Hive permission level at USER.

avatar
Super Guru

@Narasimha Gunturu

Here is a link to the Hive authorization documentation. This should be helpful for you: https://cwiki.apache.org/confluence/display/Hive/SQL+Standard+Based+Hive+Authorization

You can also do this with Ranger. Here is a tutorial: http://hortonworks.com/hadoop-tutorial/manage-security-policy-hive-hbase-knox-ranger/

avatar

@Narasimha Gunturu

if you have different different application then you can set the permission on database level or hive level.

For database level permission you can use following link:-

https://cwiki.apache.org/confluence/display/Hive/Hive+Default+Authorization+-+Legacy+Mode#HiveDefaul...

And you can use ranger to control the persmission.

avatar
Contributor

Hi Young and Zkfs,

Thanks for your valuable reply. It is very helpful.