You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by Fay Wang <fa...@yahoo.com> on 2015/06/24 07:08:32 UTC

hiveserver2 using PAM for user authentication failed

Hi,      I followed the instructions in the link below to configure hivesever2 using PAM without success:
https://cwiki.apache.org/confluence/display/Hive/Setting+Up+HiveServer2
(1) download the JPAM native library

(2) unzip and copy libjpam.so and JPam-1.1.jar to a directory (/usr/lib/pam) on the system. 

(3) add the following entries in /etc/profile.d/custom.sh: 

  export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/pam   export HADOOP_OPTS=-Djava.library.path=/usr/lib/pam
  export HADOOP_CLIENT_OPTS=-Djava.library.path=/usr/lib/pam  and add the hive-site property: hive.aux.jars.path=/usr/lib/pam/JPam-1.1.jar using Ambari
Without step (3), hive-server2 will fail with ClassNotFoundException/UnsatisfiedLinkedError. 

(4) set the following configurations in hive-site.xml:
hive.server2.authentication: PAM.hive.server2.authentication.pam.services: sshd.
(5) restart hive services via Ambari
(6) create an unix user fay with password 1qaz!QAZ
 My hive test case failed with the authentication error:
Exception in thread "main" java.sql.SQLException: Could not open client transport with JDBC Uri: jdbc:hive2://localhost:10000/default;user=fay;password=1qaz!QAZ: Peer indicated failure: Error validating the login
        at org.apache.hive.jdbc.HiveConnection.openTransport(HiveConnection.java:217)
        at org.apache.hive.jdbc.HiveConnection.<init>(HiveConnection.java:165)
        at org.apache.hive.jdbc.HiveDriver.connect(HiveDriver.java:105)
        at java.sql.DriverManager.getConnection(DriverManager.java:571)
        at java.sql.DriverManager.getConnection(DriverManager.java:215)
        at test.TestHive3.main(TestHive3.java:55)
Caused by: org.apache.thrift.transport.TTransportException: Peer indicated failure: Error validating the login
        at org.apache.thrift.transport.TSaslTransport.receiveSaslMessage(TSaslTransport.java:190)
        at org.apache.thrift.transport.TSaslTransport.open(TSaslTransport.java:288)
        at org.apache.thrift.transport.TSaslClientTransport.open(TSaslClientTransport.java:37)
        at org.apache.hive.jdbc.HiveConnection.openTransport(HiveConnection.java:192)
 Any help is highly appreciated!
Regards,Fay