<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.yoctoproject.org/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Anders+Darander</id>
	<title>Yocto Project - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.yoctoproject.org/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Anders+Darander"/>
	<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/Special:Contributions/Anders_Darander"/>
	<updated>2026-04-26T03:17:03Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.5</generator>
	<entry>
		<id>https://wiki.yoctoproject.org/wiki/index.php?title=FAQ:How_do_I_set_or_change_the_root_password&amp;diff=13049</id>
		<title>FAQ:How do I set or change the root password</title>
		<link rel="alternate" type="text/html" href="https://wiki.yoctoproject.org/wiki/index.php?title=FAQ:How_do_I_set_or_change_the_root_password&amp;diff=13049"/>
		<updated>2014-06-24T06:30:47Z</updated>

		<summary type="html">&lt;p&gt;Anders Darander: Create a function to change root password&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Q:&#039;&#039;&#039; How do I set / change the root password?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;A:&#039;&#039;&#039; In the image.bb file (eg: core-image-minimal.bb), append this text:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 ROOTFS_POSTPROCESS_COMMAND += &amp;quot;set_root_passwd;&amp;quot;&lt;br /&gt;
 set_root_passwd() {&lt;br /&gt;
    sed &#039;s%^root:[^:]*:%root:wYNffsf6sozwE:%&#039; \&lt;br /&gt;
        &amp;lt; ${IMAGE_ROOTFS}/etc/shadow \&lt;br /&gt;
        &amp;gt; ${IMAGE_ROOTFS}/etc/shadow.new;&lt;br /&gt;
    mv ${IMAGE_ROOTFS}/etc/shadow.new ${IMAGE_ROOTFS}/etc/shadow ;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
This will set the root password as &amp;quot;root&amp;quot; in the newly built image.&lt;br /&gt;
&lt;br /&gt;
To choose a different password, use the command:&lt;br /&gt;
 #passwd root &lt;br /&gt;
and copy the corresponding part of &amp;quot;/etc/shadow&amp;quot; to this text:&lt;br /&gt;
&lt;br /&gt;
eg:&lt;br /&gt;
 # cat /etc/shadow&lt;br /&gt;
 root:wYNffsf6sozwE:16122:0:99999:7:::&lt;br /&gt;
 ...&lt;br /&gt;
[[Category:FAQ]] [[Category:FAQ-open]]&lt;/div&gt;</summary>
		<author><name>Anders Darander</name></author>
	</entry>
</feed>