In core-siet.xml
add the following three lines in the configuration file
<property>
<name>hadoop.http.filter.initializers</name>
<value>org.apache.hadoop.security.AuthenticationFilterInitializer</value>
</property>
<property>
<name>hadoop.http.authentication.type</name>
<value>simple</value>
</property>
<property>
<name>hadoop.http.authentication.signature.secret.file</name>
<value>/hadoop/hdfs/hadoop-http-auth-signature-secret</value>
</property>
hadoop.http.authentication.simple.anonymous.allowed: In simple licensing model, whether to allow anonymous user request. The default value is ture, which is allowed. This parameter to flase;
Create a /hadoop/hdfs/hadoop-http-auth-signature-secret
file, which you want to enter a password
Restart hadopp cluster