Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id 2F586E00DD2; Wed, 15 May 2019 11:47:03 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on yocto-www.yoctoproject.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,HTML_MESSAGE, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low * trust * [209.222.82.67 listed in list.dnswl.org] * 0.0 HTML_MESSAGE BODY: HTML included in message Received: from 13pmail.ess.barracuda.com (13pmail.ess.barracuda.com [209.222.82.67]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id 298A9E00D2A for ; Wed, 15 May 2019 11:47:00 -0700 (PDT) Received: from SFAMAIL.SAKURAUS.LOCAL (mail.sakuraus.com [12.26.104.5]) by mx12.us-east-2b.ess.aws.cudaops.com (version=TLSv1.2 cipher=AES256-SHA256 bits=256 verify=NO); Wed, 15 May 2019 18:46:58 +0000 Received: from SFAMAIL.SAKURAUS.LOCAL (10.16.3.8) by SFAMAIL.SAKURAUS.LOCAL (10.16.3.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.669.32; Wed, 15 May 2019 11:46:56 -0700 Received: from SFAMAIL.SAKURAUS.LOCAL ([::1]) by SFAMAIL.SAKURAUS.LOCAL ([::1]) with mapi id 15.01.0669.032; Wed, 15 May 2019 11:46:56 -0700 From: Greg Wilson-Lindberg To: Rudolf J Streif , Yocto list discussion Thread-Topic: [yocto] problem adding a user Thread-Index: AdUKtI8UMCSaJnTQT92qAk6aHgoNcgAxtVKA//+VNhqAAIDUAP//it/K Date: Wed, 15 May 2019 18:46:56 +0000 Message-ID: <20cf7cd05ce54a439d05109439572db8@sakuraus.com> References: <2086bca8f57442acac5ba11c3d2712f1@sakuraus.com> <3d82053c-8db7-15af-34b8-18657749e026@ibeeto.com> <59388987f9de418abb8598790a3d3e7f@sakuraus.com>, <04dbfa63-d5a5-1aff-9d4a-87cbd9f44b5c@ibeeto.com> In-Reply-To: <04dbfa63-d5a5-1aff-9d4a-87cbd9f44b5c@ibeeto.com> Accept-Language: en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: x-originating-ip: [10.16.5.239] MIME-Version: 1.0 X-BESS-ID: 1557946018-893023-2439-35678-1 X-BESS-VER: 2019.1_20190514.2102 X-BESS-Apparent-Source-IP: 12.26.104.5 X-BESS-Outbound-Spam-Score: 0.00 X-BESS-Outbound-Spam-Report: Code version 3.2, rules version 3.2.2.213341 [from cloudscan43.us-east-2a.ess.aws.cudaops.com] Rule breakdown below pts rule name description ---- ---------------------- -------------------------------- 0.00 HTML_MESSAGE BODY: HTML included in message 0.00 BSF_BESS_OUTBOUND META: BESS Outbound X-BESS-Outbound-Spam-Status: SCORE=0.00 using account:ESS29408 scores of KILL_LEVEL=7.0 tests=HTML_MESSAGE, BSF_BESS_OUTBOUND X-BESS-BRTS-Status: 1 Subject: Re: problem adding a user X-BeenThere: yocto@yoctoproject.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Discussion of all things Yocto Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 May 2019 18:47:03 -0000 X-Groupsio-MsgNum: 45190 Content-Language: en-US Content-Type: multipart/mixed; boundary="_005_20cf7cd05ce54a439d05109439572db8sakurauscom_" --_005_20cf7cd05ce54a439d05109439572db8sakurauscom_ Content-Type: multipart/alternative; boundary="_000_20cf7cd05ce54a439d05109439572db8sakurauscom_" --_000_20cf7cd05ce54a439d05109439572db8sakurauscom_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi Rudolf, 1st, yes I inherit extrausers. Attached are the passwd & shadow files. It shouldn't make any difference, but I'm building this for an RPi3 using t= he Qt Boot2Qt version of the Yocto environment, distro 2.5.3. Greg ________________________________ From: Rudolf J Streif Sent: Wednesday, May 15, 2019 11:26 AM To: Greg Wilson-Lindberg; Yocto list discussion Subject: Re: [yocto] problem adding a user Hi Greg, > I've also tried both the back-quote and the single-quote, no difference. Help me to understand this. the back-quotes are the right ones. If you use = the single ones your password in the /etc/shadow ends up being 'openssl pas= swd test' (without the quotes), unless the build fails because of a parsing= error (I have not tried it). Silly question, you did inherit extrausers cl= ass? Can you post your /etc/passwd and /etc/shadow I am surprised that this does not work with your setup. I have been doing t= his a gazillion times always with success. :rjs On 5/15/19 11:03 AM, Greg Wilson-Lindberg wrote: Hi Rudolf, Thanks for the reply, and the information on how openssl works. I'm trying to create a user with the same group name so the code that I'm u= sing reduces to: EXTRA_USERS_PARAMS =3D "\ useradd -p `openssl passwd test` sakura; \ usermod -a -G sudo ${SAKURA_USER}; \ " I also, as you can see, removed the macros to eliminate as much confusion a= s possible. I still can't login in using the password 'test'. I've also tried both the back-quote and the single-quote, no difference. Regards, Greg ________________________________ From: Rudolf J Streif Sent: Wednesday, May 15, 2019 10:07:47 AM To: Greg Wilson-Lindberg; Yocto list discussion Subject: Re: [yocto] problem adding a user Hi Greg, Well, I suppose I wrote the book you are referring to... Using useradd -p PASSWORD USER takes the password hash for PASSWORD hence the use of openssl in: useadd -p `openssl passwd PASSWORD` USER openssl password creates the password hash using the original crypt hash algorithm if no other options are specified. e.g. $ openssl passwd hello 6hEsTksgRkeiI With this the first two characters of the output is the salt and the rest is the password hash. If you want openssl to create the same result again: $ openssl passwd -salt "6h" hello 6hEsTksgRkeiI You can use newer algorithms like MD5 based BSD password algorithm 1: $ openssl passwd -1 hello $1$4Mu8Fcs.$eIKgPP7RCYrb3lFZjhADA1 $1 : password algorithm 1 $4Mu8Fcs. : salt $eIKgPP7RCYrb3lFZjhADA1 : password hash If you log into the system you have to use the clear password. The system reads the salt, creates the password hash and compares the results. :rjs On 5/14/19 5:34 PM, Greg Wilson-Lindberg wrote: > I'm trying to use the example in "Embedded Linux Systems with the Yocto P= roject" to add a user to my Yocto build. In the book the sample code: > > useradd -p `openssl passwd ${DEV_PASSWORD}` developer; \ > > uses openssl to generate the encrypted password string to pass to useradd= . I have never been able to get this to work. When I run the openssl > command on the cmd line I get a different value every time, this seems wr= ong, How can the password code compare against it if every encode > produces a different value? > > I am getting the user added to the system, the home directory shows up an= d the user is in the passwd and group files. I just can't login to the > account. > > I've obviously got something confused, any help would be appreciated. > > Greg Wilson-Lindberg > -- ----- Rudolf J Streif CEO/CTO ibeeto +1.855.442.3396 x700 -- ----- Rudolf J Streif CEO/CTO ibeeto +1.855.442.3396 x700 --_000_20cf7cd05ce54a439d05109439572db8sakurauscom_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable

Hi Rudolf,

1st, yes I inherit extrausers. Attached are the passwd & shadow file= s.


It shouldn't make any difference, but I'm building this for an RPi3 usin= g the Qt Boot2Qt version of the Yocto environment, distro 2.5.3.


Greg


From: Rudolf J Streif <r= udolf.streif@ibeeto.com>
Sent: Wednesday, May 15, 2019 11:26 AM
To: Greg Wilson-Lindberg; Yocto list discussion
Subject: Re: [yocto] problem adding a user
 

Hi Greg,


> I've also tried both the back-quote and the single-quote, no differ= ence.


Help me to understand this. the back-quotes are the right ones. If you u= se the single ones your password in the /etc/shadow ends up being 'openssl = passwd test' (without the quotes), unless the build fails because of a pars= ing error (I have not tried it). Silly question, you did inherit extrausers class?


Can you post your /etc/passwd and /etc/shadow


I am surprised that this does not work with your setup. I have been doin= g this a gazillion times always with success.


:rjs




On 5/15/19 11:03 AM, Greg Wilson-Lindberg wr= ote:

Hi Rudolf,

Thanks for the reply, and the information on how openssl works.


I'm trying to create a user with the same group name so the code that I'= m using reduces to:

EXTRA_USERS_PARAMS =3D "\=0A=
    useradd -p `openssl passwd test` sakura; \=0A=
    usermod -a -G sudo ${SAKURA_USER}; \=0A=
    "=0A=
I also, as you can see, removed the macros to eliminate as much confusion a= s possible.


I still can't login in using the password 'te= st'.


I've also tried both the back-quote and the single-quote, no difference.=

Regards,


Greg


From: Rudolf J Streif <rudolf.streif@ibeeto.com>
Sent: Wednesday, May 15, 2019 10:07:47 AM
To: Greg Wilson-Lindberg; Yocto list discussion
Subject: Re: [yocto] problem adding a user
 
Hi Greg,

Well, I suppose I wrote the book you are referring to...


Using

useradd -p PASSWORD USER

takes the password hash for PASSWORD hence the use of openssl in:

useadd -p `openssl passwd PASSWORD` USER

openssl password creates the password hash using the original crypt hash algorithm if no other options are specified. e.g.

$ openssl passwd hello
6hEsTksgRkeiI

With this the first two characters of the output is the salt and the
rest is the password hash. If you want openssl to create the same result again:

$ openssl passwd -salt "6h" hello
6hEsTksgRkeiI

You can use newer algorithms like MD5 based BSD password algorithm 1:

$ openssl passwd -1 hello
$1$4Mu8Fcs.$eIKgPP7RCYrb3lFZjhADA1

$1 : password algorithm 1
$4Mu8Fcs. : salt
$eIKgPP7RCYrb3lFZjhADA1 : password hash


If you log into the system you have to use the clear password. The
system reads the salt, creates the password hash and compares the results.<= br>

:rjs


On 5/14/19 5:34 PM, Greg Wilson-Lindberg wrote:
> I'm trying to use the example in "Embedded Linux Systems with the= Yocto Project" to add a user to my Yocto build. In the book the sampl= e code:
>
>     useradd -p `openssl passwd ${DEV_PASSWORD}` de= veloper; \
>
> uses openssl to generate the encrypted password string to pass to user= add. I have never been able to get this to work. When I run the openssl
> command on the cmd line I get a different value every time, this seems= wrong, How can the password code compare against it if every encode
> produces a different value?
>
> I am getting the user added to the system, the home directory shows up= and the user is in the passwd and group files. I just can't login to the > account.
>
> I've obviously got something confused, any help would be appreciated.<= br> >
> Greg Wilson-Lindberg
>  

--
-----
Rudolf J Streif
CEO/CTO ibeeto
+1.855.442.3396 x700

-- =0A=
-----=0A=
Rudolf J Streif=0A=
CEO/CTO ibeeto=0A=
+1.855.442.3396 x700
--_000_20cf7cd05ce54a439d05109439572db8sakurauscom_-- --_005_20cf7cd05ce54a439d05109439572db8sakurauscom_ Content-Type: application/octet-stream; name="passwd" Content-Description: passwd Content-Disposition: attachment; filename="passwd"; size=1128; creation-date="Wed, 15 May 2019 18:37:26 GMT"; modification-date="Wed, 15 May 2019 18:37:26 GMT" Content-Transfer-Encoding: base64 cm9vdDp4OjA6MDpyb290Oi9ob21lL3Jvb3Q6L2Jpbi9zaApkYWVtb246eDoxOjE6ZGFlbW9uOi91 c3Ivc2JpbjovYmluL3NoCmJpbjp4OjI6MjpiaW46L2JpbjovYmluL3NoCnN5czp4OjM6MzpzeXM6 L2RldjovYmluL3NoCnN5bmM6eDo0OjY1NTM0OnN5bmM6L2JpbjovYmluL3N5bmMKZ2FtZXM6eDo1 OjYwOmdhbWVzOi91c3IvZ2FtZXM6L2Jpbi9zaAptYW46eDo2OjEyOm1hbjovdmFyL2NhY2hlL21h bjovYmluL3NoCmxwOng6Nzo3OmxwOi92YXIvc3Bvb2wvbHBkOi9iaW4vc2gKbWFpbDp4Ojg6ODpt YWlsOi92YXIvbWFpbDovYmluL3NoCm5ld3M6eDo5Ojk6bmV3czovdmFyL3Nwb29sL25ld3M6L2Jp bi9zaAp1dWNwOng6MTA6MTA6dXVjcDovdmFyL3Nwb29sL3V1Y3A6L2Jpbi9zaApwcm94eTp4OjEz OjEzOnByb3h5Oi9iaW46L2Jpbi9zaAp3d3ctZGF0YTp4OjMzOjMzOnd3dy1kYXRhOi92YXIvd3d3 Oi9iaW4vc2gKYmFja3VwOng6MzQ6MzQ6YmFja3VwOi92YXIvYmFja3VwczovYmluL3NoCmxpc3Q6 eDozODozODpNYWlsaW5nIExpc3QgTWFuYWdlcjovdmFyL2xpc3Q6L2Jpbi9zaAppcmM6eDozOToz OTppcmNkOi92YXIvcnVuL2lyY2Q6L2Jpbi9zaApnbmF0czp4OjQxOjQxOkduYXRzIEJ1Zy1SZXBv cnRpbmcgU3lzdGVtIChhZG1pbik6L3Zhci9saWIvZ25hdHM6L2Jpbi9zaApteXNxbDp4Ojk5MDo5 ODc6Oi92YXIvbXlzcWw6L2Jpbi9mYWxzZQpzeXN0ZW1kLWJ1cy1wcm94eTp4Ojk5MTo5ODg6Oi86 L2Jpbi9ub2xvZ2luCnBvbGtpdGQ6eDo5OTI6OTkwOjovZXRjL3BvbGtpdC0xOi9iaW4vc2gKc3lz dGVtZC1yZXNvbHZlOng6OTkzOjk5MTo6LzovYmluL25vbG9naW4Kc3lzdGVtZC1uZXR3b3JrOng6 OTk0Ojk5Mjo6LzovYmluL25vbG9naW4Kc3lzdGVtZC10aW1lc3luYzp4Ojk5NTo5OTM6Oi86L2Jp bi9ub2xvZ2luCm1lc3NhZ2VidXM6eDo5OTY6OTk1OjovdmFyL2xpYi9kYnVzOi9iaW4vZmFsc2UK c2FrdXJhOng6OTk3Ojk5Nzo6L2hvbWUvc2FrdXJhOi9iaW4vYmFzaApzc2hkOng6OTk4Ojk5ODo6 L3Zhci9ydW4vc3NoZDovYmluL2ZhbHNlCnJwYzp4Ojk5OTo5OTk6Oi86L2Jpbi9mYWxzZQpub2Jv ZHk6eDo2NTUzNDo2NTUzNDpub2JvZHk6L25vbmV4aXN0ZW50Oi9iaW4vc2gK --_005_20cf7cd05ce54a439d05109439572db8sakurauscom_ Content-Type: application/octet-stream; name="shadow" Content-Description: shadow Content-Disposition: attachment; filename="shadow"; size=792; creation-date="Wed, 15 May 2019 18:40:23 GMT"; modification-date="Wed, 15 May 2019 18:40:23 GMT" Content-Transfer-Encoding: base64 cm9vdDo6MTgwMzE6MDo5OTk5OTo3Ojo6CmRhZW1vbjoqOjE4MDMxOjA6OTk5OTk6Nzo6OgpiaW46 KjoxODAzMTowOjk5OTk5Ojc6OjoKc3lzOio6MTgwMzE6MDo5OTk5OTo3Ojo6CnN5bmM6KjoxODAz MTowOjk5OTk5Ojc6OjoKZ2FtZXM6KjoxODAzMTowOjk5OTk5Ojc6OjoKbWFuOio6MTgwMzE6MDo5 OTk5OTo3Ojo6CmxwOio6MTgwMzE6MDo5OTk5OTo3Ojo6Cm1haWw6Kj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