<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>5365</bug_id>
          
          <creation_ts>2013-10-18 09:59:58 +0000</creation_ts>
          <short_desc>ability to set root password in cleartext</short_desc>
          <delta_ts>2014-02-05 12:49:36 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>OE-Core</product>
          <component>core</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>VERIFIED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>1.6 M1</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Jack Mitchell">jack</reporter>
          <assigned_to name="Chen Qi">Qi.Chen</assigned_to>
          <cc>bluelightning</cc>
    
    <cc>ke.zou</cc>
    
    <cc>lpapp</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>Qi.Chen</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Yes (doc changes required)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>38034</commentid>
    <comment_count>0</comment_count>
    <who name="Jack Mitchell">jack</who>
    <bug_when>2013-10-18 09:59:58 +0000</bug_when>
    <thetext>Setting the root password currently involves generating your password hash using crypt and adding the following to your local.conf/distro.conf

INHERIT += &quot;extrausers&quot;

EXTRA_USERS_PARAMS = &quot;\
    usermod -p &apos;\$6\$1BBHm9j1\$Kq6cRYht.cgAEF9DMZg6x2CmnFuJh6R64awVujE60ghOA9rl5TqmPDTRzXFlJ1gQur6mKUSGBMQuqvOTveLto1&apos; root; \
    &quot;

This is rife with issues. There should be a defined way to set a default, cleartext root password.

Issues I encountered when trying this:

- $ signs were emitted I assume due to the code thinking they were variables
- I generated the hash wrong, multiple times.
- I had to learn how shadow and passwd worked together (which IMO shouldn&apos;t be a requiste for setting a default root password.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>39070</commentid>
    <comment_count>1</comment_count>
    <who name="Laszlo Papp">lpapp</who>
    <bug_when>2013-11-25 14:59:04 +0000</bug_when>
    <thetext>You did not mention what exactly you would like or it is unclear to me.

My problem is that I do not have a dedicated variable this, but I am fine with the hash.

You would like to cover here both? Could you please provide an expected output you desire to have?

Currently, the title is not in sync with the content for me. If I read the title, it suggest that the only problem is that you need to type hash, not clear text.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>39087</commentid>
    <comment_count>2</comment_count>
    <who name="Jack Mitchell">jack</who>
    <bug_when>2013-11-26 11:29:34 +0000</bug_when>
    <thetext>To currently set the root password you must do this:

INHERIT += &quot;extrausers&quot;

EXTRA_USERS_PARAMS = &quot;\
    usermod -p &apos;\$6\$1BBHm9j1\$Kq6cRYht.cgAEF9DMZg6x2CmnFuJh6R64awVujE60ghOA9rl5TqmPDTRzXFlJ1gQur6mKUSGBMQuqvOTveLto1&apos; root; \
    &quot;

ROOTFS_POSTPROCESS_COMMAND_append = &quot; \
  sed -i &apos;s/*/x/&apos; \
  ${IMAGE_ROOTFS}/etc/passwd ;&quot; 

What I would like to be able to do is set a variable with the root password. Root is a special case so I don&apos;t think something like:

inherit useradd

USERADD_PACKAGES = &quot;${PN}&quot;

USERADD_ROOT_PASSWD = &quot;password&quot;

is unreasonable, but to be honest as long as I can set it in cleartext without manually hacking the rootfs, I will be happy.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>39088</commentid>
    <comment_count>3</comment_count>
    <who name="Laszlo Papp">lpapp</who>
    <bug_when>2013-11-26 11:32:00 +0000</bug_when>
    <thetext>But clear text would impose security risk IMHO, so I think it should accept hashes, too, not just clear text if this feature is implemented...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>39090</commentid>
    <comment_count>4</comment_count>
    <who name="Jack Mitchell">jack</who>
    <bug_when>2013-11-26 11:43:12 +0000</bug_when>
    <thetext>Yes, hash and cleartext would be fine. However if you don&apos;t do anything then the password is empty by default... isn&apos;t that the greater security risk? 

I would also worry about who gets to see the password in clear text if you deem that a security risk. You don&apos;t go sharing your internal corporate layers with the general public, so anyone who sees it, will probably already know the password....</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>39096</commentid>
    <comment_count>5</comment_count>
    <who name="Laszlo Papp">lpapp</who>
    <bug_when>2013-11-26 14:38:48 +0000</bug_when>
    <thetext>Well, security attacks are not black and white. Someone may realize it on your monitor who should not. It is not hypothetical, but a daily situation in many companies people come and go. There are also silent malicious people and programs which attack when you do not expect (accidentally in the worst moments with stealing the most secret stuff...).

So, in general, clear text should not be exclusively available. Sha support would still be nice alongside.

I do not comment on the no password scenario much because that is not the question here. We are both here to say that, that is not OK.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>39437</commentid>
    <comment_count>6</comment_count>
    <who name="Chen Qi">Qi.Chen</who>
    <bug_when>2013-12-17 07:15:23 +0000</bug_when>
    <thetext>merged into poky/master:
36fe775672d66e3d83575eb532eb6ab5109343b4
c38fee231b42b9123dd1fd102235eac6240ba4c8
7b58b5feaa22c82e997165fc130c8545f5b1a129

http://git.openembedded.org/?p=openembedded-core.git&amp;a=commit;h=31dee7946340bf0f1e94e4e714191d3d6ca3bf6a

//Chen Qi</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>39439</commentid>
    <comment_count>7</comment_count>
    <who name="Laszlo Papp">lpapp</who>
    <bug_when>2013-12-17 07:21:35 +0000</bug_when>
    <thetext>Well, one of two concerns is still unresolved. Shall I open a separate bugreport for that? I think there could be a better interface than usermod -p with EXTRA_USERS_PARAMS since it is a common operation in my opinion. Currently, it is a bit raw.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>39440</commentid>
    <comment_count>8</comment_count>
    <who name="Chen Qi">Qi.Chen</who>
    <bug_when>2013-12-17 07:29:46 +0000</bug_when>
    <thetext>(In reply to comment #7)
&gt; Well, one of two concerns is still unresolved. Shall I open a separate
&gt; bugreport for that? I think there could be a better interface than usermod
&gt; -p with EXTRA_USERS_PARAMS since it is a common operation in my opinion.
&gt; Currently, it is a bit raw.

Yes. Please.
Do you mean a better interface to set root password?
Something like ROOT_PASSWD = &quot;xxx&quot; image recipes or configuration file?

Regards,
Chen Qi</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>39441</commentid>
    <comment_count>9</comment_count>
    <who name="Chen Qi">Qi.Chen</who>
    <bug_when>2013-12-17 07:31:49 +0000</bug_when>
    <thetext>(In reply to comment #8)
&gt; (In reply to comment #7)
&gt; &gt; Well, one of two concerns is still unresolved. Shall I open a separate
&gt; &gt; bugreport for that? I think there could be a better interface than usermod
&gt; &gt; -p with EXTRA_USERS_PARAMS since it is a common operation in my opinion.
&gt; &gt; Currently, it is a bit raw.
&gt; 
&gt; Yes. Please.
&gt; Do you mean a better interface to set root password?
&gt; Something like ROOT_PASSWD = &quot;xxx&quot; image recipes or configuration file?
&gt; 

Something like ROOT_PASSWD = &quot;xxx&quot; in image recipes or configuration files?

&gt; Regards,
&gt; Chen Qi</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>39443</commentid>
    <comment_count>10</comment_count>
    <who name="Laszlo Papp">lpapp</who>
    <bug_when>2013-12-17 07:36:12 +0000</bug_when>
    <thetext>Yes, that is what exactly I had in mind as well, thanks. Reported:

https://bugzilla.yoctoproject.org/show_bug.cgi?id=5675

Also, thanks for working on this bug to be able to set clear text password.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>39579</commentid>
    <comment_count>11</comment_count>
    <who name="Ke Zou">ke.zou</who>
    <bug_when>2013-12-24 05:26:28 +0000</bug_when>
    <thetext>verified with poky master:005af45191ded6185c618c708181b31281e43092

Test steps:
add following lines in build/conf/local.conf

INHERIT += &quot;extrausers&quot;

EXTRA_USERS_PARAMS = &quot;\
useradd -p &apos;&apos; -u 1200 -d /home/user1 -r -s /bin/bash user1; \
useradd -p &apos;vz4kBbiMF9z6E&apos; -u 1201 -d /home/user2 -r -s /bin/bash user2; \
useradd -u 1202 -d /home/user3 -r -s /bin/bash -P &apos;user3&apos; user3; \
&quot;

build sato image and boot,
You can login with user3:user3</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>39582</commentid>
    <comment_count>12</comment_count>
    <who name="Laszlo Papp">lpapp</who>
    <bug_when>2013-12-24 08:18:32 +0000</bug_when>
    <thetext>Great, thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>40066</commentid>
    <comment_count>13</comment_count>
    <who name="Laszlo Papp">lpapp</who>
    <bug_when>2014-01-28 17:42:59 +0000</bug_when>
    <thetext>Chen, do you mind implementing this one, too?

https://bugzilla.yoctoproject.org/show_bug.cgi?id=5675

IMO, that would be a great progress. Currently, any Linux installation I have used out there, has an easy &quot;root&quot; password setting step included.

It is a pity that Yocto does not have it yet.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>40192</commentid>
    <comment_count>14</comment_count>
    <who name="Laszlo Papp">lpapp</who>
    <bug_when>2014-02-05 12:49:36 +0000</bug_when>
    <thetext>For the record, &quot;extrausers&quot; was not available in dylan, so it is a dora only and on feature. :-/

Perhaps, someone could backport it if it is just mostly about the extrausers class.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>