<p>I am reading a blog to integrate EFK(a log system) into k8s in centos 7.4. There are following instructions:</p>

<pre><code># mkdir ~/es_data
# chmod g+rwx es_data
# chgrp 1000 es_data
# chown 1000 -R es_data

# ls -l /root/es_data/
total 8
drwxrwxr-x 2 1000 1000 4096 Jun  8 09:50 ./
drwx------ 8 root root 4096 Jun  8 09:50 ../
</code></pre>

<p>I log in as root. The instructions say, If I do chgrp 1000 es_data and chown 1000 -R es_data, the director's owner and group would be 1000. But when I follow the instructions:</p>

<p>I see following:</p>

<pre><code> drwxr-xr-x.  2 master16g master16g    6 Jul 11 15:27 es_data
</code></pre>

<p>The owner and group appears to machine hostname, <code>master16g</code>.  </p>

<p>Could someone drop me hints what happens here for <code>chgrp 1000 and chown 1000</code>?</p>

<p><code>chown</code> changes the owner, <code>chgrp</code> changes the group. Because you have user and group both named <code>master16g</code> having <code>1000</code> as UID and GID respectively, this is why you see the user name and the group name on the list. <code>chown</code> accepts UID as parameter as well as username, this is well documented in the manual. <code>chgrp</code> also accepts GID and group name. You can change both also with one command <code>chown 1000:1000 es_data -R</code> or <code>chown master16g:master16g es_data -R</code>.</p>
<p>First Linux user has usually UID/GID 1000.</p>
<p>For instance, if you <code>chown 0:1000 file</code> you will see <code>root:master16g</code> as the file owner.</p>
<p>You can get the details of the <code>elasticsearch</code> user by running <code>id elasticsearch</code>.</p>
