Linux + Hadoop privilege management

Time:2021-1-11

Hadoop system permission

[[email protected] ~]# hadoop fs -mkdir /tmp/tmp_authority
[[email protected] ~]# hadoop fs -ls -h /tmp
Found 7 items
drwxrwxrwx   - hdfs   supergroup          0 2014-12-15 15:45 /tmp/.cloudera_health_monitoring_canary_files
drwxr-xr-x   - yarn   supergroup          0 2014-10-16 15:07 /tmp/hadoop-yarn
drwxrwxrwx   - hive   supergroup          0 2014-10-30 15:03 /tmp/hive-hive
drwxrwxrwx   - nobody supergroup          0 2014-12-15 14:39 /tmp/hive-nobody
drwxr-xr-x   - root   supergroup          0 2014-12-15 15:36 /tmp/hive-root
drwxrwxrwt   - mapred hadoop              0 2014-10-13 16:53 /tmp/logs
drwxr-xr-x   - root   supergroup          0 2014-12-15 15:45 /tmp/tmp_authority
[[email protected] ~]# hadoop fs -chgrp -R root /tmp/tmp_authority
[[email protected] ~]# hadoop fs -ls -h /tmp
Found 7 items
drwxrwxrwx   - hdfs   supergroup          0 2014-12-15 15:46 /tmp/.cloudera_health_monitoring_canary_files
drwxr-xr-x   - yarn   supergroup          0 2014-10-16 15:07 /tmp/hadoop-yarn
drwxrwxrwx   - hive   supergroup          0 2014-10-30 15:03 /tmp/hive-hive
drwxrwxrwx   - nobody supergroup          0 2014-12-15 14:39 /tmp/hive-nobody
drwxr-xr-x   - root   supergroup          0 2014-12-15 15:36 /tmp/hive-root
drwxrwxrwt   - mapred hadoop              0 2014-10-13 16:53 /tmp/logs
drwxr-xr-x   - root   root                0 2014-12-15 15:45 /tmp/tmp_authority

Linux add groups and users

  1. Create group
groupadd query
  1. New user join group
useradd -g query query
  1. Old users join another group
usermod -a -G root query
[[email protected] ~]# groups query
query : query root
[[email protected] ~]# usermod -G query query
[[email protected] ~]# groups query
query : query

  1. delete group