最近在
Hadoop
大数据分析上很流行一个叫/var/tmp/java -c /var/tmp/w.conf
的病毒程序,当然了,我本人也被中招了,后来就把在/var/tmp/
里面的程序删除了,并且将定时任务crontab
也清掉才行,那么问题来了,如何能有效阻止黑客利用hadoop yarn
入侵我们的服务器?授权很重要。
在core-siet.xml
配置文件中增加如下三行
<property>
<name>hadoop.http.filter.initializersname>
<value>org.apache.hadoop.security.AuthenticationFilterInitializervalue>
property>
<property>
<name>hadoop.http.authentication.typename>
<value>simplevalue>
property>
<property>
<name>hadoop.http.authentication.signature.secret.filename>
<value>/hadoop/hdfs/hadoop-http-auth-signature-secretvalue>
property>
创建/hadoop/hdfs/hadoop-http-auth-signature-secret
文件,里面输入自己想要的密码
scp core-site.xml node1:/hadoop_home/etc/hadoop/...
./stop-all.sh
./start-all.sh
http://localhost:50070?user.nam=你的密码
第一次输入需要,后面会将类似以下信息放到浏览器Cookies中
hadoop.auth="u=你的密码&p=你的密码&t=simple&e=1530846740246&s=xxxxxx"