在core-siet.xml
配置文件中增加如下三行
<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:在simple授权模式下,是否允许匿名用户请求。默认值是ture,也就是允许。 将这个参数改为flase;
创建/hadoop/hdfs/hadoop-http-auth-signature-secret
文件,里面输入自己想要的密码
重启hadopp集群