0
0
Hadoopdata~20 mins

Kerberos authentication in Hadoop - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Kerberos Authentication Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:30remaining
What is the primary purpose of Kerberos in Hadoop?

Kerberos is used in Hadoop clusters for security. What is its main role?

ATo authenticate users and services securely using tickets
BTo encrypt data stored in HDFS automatically
CTo manage resource allocation among cluster nodes
DTo monitor cluster health and performance
Attempts:
2 left
💡 Hint

Think about how Kerberos helps prove identity without sending passwords.

Predict Output
intermediate
1:00remaining
What is the output of this Kerberos ticket command?

Given the command klist run after successful authentication, what output will it show?

Hadoop
klist
AList of valid Kerberos tickets with expiration times
BError: command not found
CList of Hadoop cluster nodes
DCurrent HDFS directory contents
Attempts:
2 left
💡 Hint

Consider what klist is used for in Kerberos.

data_output
advanced
2:00remaining
What is the result of this Hadoop Kerberos authentication code snippet?

Consider this Java snippet for authenticating a user with Kerberos in Hadoop:

Configuration conf = new Configuration();
conf.set("hadoop.security.authentication", "kerberos");
UserGroupInformation.setConfiguration(conf);
UserGroupInformation.loginUserFromKeytab("user@EXAMPLE.COM", "/path/to/user.keytab");
String user = UserGroupInformation.getCurrentUser().getUserName();
System.out.println(user);

What will be printed?

AException thrown at loginUserFromKeytab
Buser@EXAMPLE.COM
Cnull
Duser
Attempts:
2 left
💡 Hint

Check what getUserName() returns after login.

🔧 Debug
advanced
1:30remaining
Why does this Kerberos authentication fail in Hadoop?

Given this error message when running a Hadoop job with Kerberos enabled:

javax.security.auth.login.LoginException: Cannot obtain password from user

Which of the following is the most likely cause?

AThe Hadoop cluster is not running
BThe user does not have HDFS read permissions
CThe keytab file path is incorrect or inaccessible
DThe Kerberos ticket has expired but was renewed automatically
Attempts:
2 left
💡 Hint

Check file paths and permissions related to authentication files.

🚀 Application
expert
2:00remaining
How many valid Kerberos tickets will be listed after these commands?

A user runs these commands in order:

kinit -kt /path/to/user1.keytab user1@EXAMPLE.COM
kinit -kt /path/to/user2.keytab user2@EXAMPLE.COM
klist

How many valid tickets will klist show?

A2
B1
C0
DDepends on the Kerberos configuration
Attempts:
2 left
💡 Hint

Consider how kinit manages tickets in the default ticket cache.