<div dir="ltr">Hi Robert, <div><br></div><div>Thanks for the patch. I tested it and it worked ... partially.</div><div><br></div><div>Taking an existing image and then using `opkg install base-files.ipk` will correctly set the permission to 0700.</div><div><br></div><div>However, when I rebuild the full image rootfs, /home/root still ends up with the wrong permission. I suspect another recipe is modifying the permission. Is there a way (ie. bitbake command) to find out which recipe is causing the change?  </div><div><br></div><div>Thanks again,</div><div>Charles</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Apr 5, 2016 at 10:33 PM, Robert Yang <span dir="ltr">&lt;<a href="mailto:liezhi.yang@windriver.com" target="_blank">liezhi.yang@windriver.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
I think that it should be a bug, would you please try this patch?<br>
<br>
diff --git a/meta/recipes-core/base-files/<a href="http://base-files_3.0.14.bb" rel="noreferrer" target="_blank">base-files_3.0.14.bb</a> b/meta/recipes-core/base-files/<a href="http://base-files_3.0.14.bb" rel="noreferrer" target="_blank">base-files_3.0.14.bb</a><br>
index d391707..2082ed4 100644<br>
--- a/meta/recipes-core/base-files/<a href="http://base-files_3.0.14.bb" rel="noreferrer" target="_blank">base-files_3.0.14.bb</a><br>
+++ b/meta/recipes-core/base-files/<a href="http://base-files_3.0.14.bb" rel="noreferrer" target="_blank">base-files_3.0.14.bb</a><br>
@@ -95,6 +95,7 @@ do_install () {<br>
        for d in ${dirs755}; do<br>
                install -m 0755 -d ${D}$d<br>
        done<br>
+       chmod 0700 ${D}${ROOT_HOME}<br>
        for d in ${dirs1777}; do<br>
                install -m 1777 -d ${D}$d<br>
        done<br>
<br>
// Robert<span class=""><br>
<br>
On 04/06/2016 01:03 PM, Charles Chan wrote:<br>
</span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
(This is my first post to OE list, hopefully I am posting to the right mailing<br>
list.)<br>
<br>
Background: During the process of trying to configure SSH keys for root user<br>
login via dropbear, we realized the permission for /home/root directory is set<br>
too loose for group and other members [1]. As a result, dropbears fails when we<br>
try to put the key under /home/root/.ssh<br>
<br>
---------<br>
<br>
In the image, /home/root directory is set to 0755:<br>
<br>
    $ stat /home/root<br>
       File: /home/root<br>
       Size: 4096            Blocks: 8          IO Block: 4096   directory<br>
    Device: b302h/45826d    Inode: 13268       Links: 4<br>
    Access: (0755/drwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)<br>
    Access: 2016-04-05 22:21:13.000000000<br>
    Modify: 2016-04-05 22:08:57.000000000<br>
    Change: 2016-04-05 22:08:57.000000000<br>
<br>
<br>
After some debugging, we believe the permission (0755) is initialized in<br>
</span><a href="http://base-files_3.0.14.bb" rel="noreferrer" target="_blank">base-files_3.0.14.bb</a> &lt;<a href="http://base-files_3.0.14.bb" rel="noreferrer" target="_blank">http://base-files_3.0.14.bb</a>&gt; (in line 35) [2].<span class=""><br>
<br>
A few questions:<br>
1. I tried looking at the git log for the history, but wasn&#39;t able to find any<br>
background on why the permission was set this way. eg. on a desktop Linux<br>
(Ubuntu), /root is set to 0700:<br>
<br>
    $ sudo stat /root<br>
       File: `/root&#39;<br>
       Size: 4096 Blocks: 8          IO Block: 4096   directory<br></span>
    Device: 801h/2049dInode: 1441793     Links: 3<span class=""><br>
    Access: (0700/drwx------)  Uid: (    0/    root)   Gid: (    0/    root)<br>
    Access: 2016-04-05 21:29:17.389725228 -0700<br>
    Modify: 2016-03-22 17:11:54.912479000 -0700<br>
    Change: 2016-03-22 17:11:54.912479000 -0700<br>
      Birth: -<br>
<br>
<br>
2. If we would like to override the directory permission for /home/root in our<br>
image, what is the best way to do it? I am not an expert with bitbake, should I<br></span>
be patching the <a href="http://base-files_3.0.14.bb" rel="noreferrer" target="_blank">base-files_3.0.14.bb</a> &lt;<a href="http://base-files_3.0.14.bb" rel="noreferrer" target="_blank">http://base-files_3.0.14.bb</a>&gt;? using<span class=""><br>
*_append? or I should be looking at some other recipe altogether?<br>
<br>
Sorry for the long email. Thanks in advance.<br>
Charles<br>
<br>
[1] <a href="https://wiki.openwrt.org/doc/howto/dropbear.public-key.auth#troubleshooting" rel="noreferrer" target="_blank">https://wiki.openwrt.org/doc/howto/dropbear.public-key.auth#troubleshooting</a><br>
<br>
[2]<br>
<a href="http://cgit.openembedded.org/cgit.cgi/openembedded-core/tree/meta/recipes-core/base-files/base-files_3.0.14.bb?h=master#n35" rel="noreferrer" target="_blank">http://cgit.openembedded.org/cgit.cgi/openembedded-core/tree/meta/recipes-core/base-files/base-files_3.0.14.bb?h=master#n35</a><br>
<br>
<br>
</span></blockquote>
</blockquote></div><br></div>