<div dir="ltr">I believe it is cloud-init, which is installed by default on all the Ubuntu AMI images, that is changing your password for the ububtu user.<div><br></div><div>So to verify, after you boot up an instance with your new AMI, get the instance&#39;s console output by using the &quot;Get System Log&quot; action. If there is a line like: Changing password for ubuntu, or anything related to password in the boot log, then we can fix that for you by changing the cloud-init behavior.</div>
</div><div class="gmail_extra"><br clear="all"><div>Rayson<br><br>==================================================<br>Open Grid Scheduler - The Official Open Source Grid Engine<br><a href="http://gridscheduler.sourceforge.net/" target="_blank">http://gridscheduler.sourceforge.net/</a><br>
<a href="http://gridscheduler.sourceforge.net/GridEngine/GridEngineCloud.html" target="_blank">http://gridscheduler.sourceforge.net/GridEngine/GridEngineCloud.html</a></div>
<br><br><div class="gmail_quote">On Tue, Jun 17, 2014 at 5:16 PM, Dan Tenenbaum <span dir="ltr">&lt;<a href="mailto:dtenenba@fhcrc.org" target="_blank">dtenenba@fhcrc.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
However, I just reproduced the problem in a few simpler steps:<br>
<br>
- launched an instance of the sc ami ami-3393a45a (in the aws console)<br>
- ssh&#39;d to it, changed ubuntu&#39;s password to foobar<br>
- verified that the change worked by doing &#39;su - ubuntu&#39;<br>
- created an image (again in the console) based on that instance<br>
- started a new instance of the image from the last step<br>
- ssh&#39;d in as ubuntu<br>
- &#39;su - ubuntu&#39; with the password I set fails.<br>
<div class="im HOEnZb"><br>
Dan<br>
<br>
<br>
----- Original Message -----<br>
</div><div class="im HOEnZb">&gt; From: &quot;Dan Tenenbaum&quot; &lt;<a href="mailto:dtenenba@fhcrc.org">dtenenba@fhcrc.org</a>&gt;<br>
&gt; To: &quot;Rayson Ho&quot; &lt;<a href="mailto:raysonlogin@gmail.com">raysonlogin@gmail.com</a>&gt;<br>
&gt; Cc: <a href="mailto:starcluster@mit.edu">starcluster@mit.edu</a><br>
</div><div class="HOEnZb"><div class="h5">&gt; Sent: Tuesday, June 17, 2014 1:54:45 PM<br>
&gt; Subject: Re: [StarCluster] problem modifying starcluster AMI - ubuntu password change does not persist<br>
&gt;<br>
&gt; Hi Rayson,<br>
&gt;<br>
&gt; I went through a couple of iterations.<br>
&gt;<br>
&gt; I started by using launching the SC AMI with the command documented<br>
&gt; at<br>
&gt; <a href="http://star.mit.edu/cluster/docs/latest/manual/create_new_ami.html" target="_blank">http://star.mit.edu/cluster/docs/latest/manual/create_new_ami.html</a><br>
&gt; ( starcluster start -o -s 1 -I &lt;INSTANCE-TYPE&gt; -m &lt;BASE-AMI-ID&gt;<br>
&gt; imagehost)<br>
&gt;<br>
&gt; Then I added chef to the running instance (I did not change any<br>
&gt; passwords at this point).<br>
&gt;<br>
&gt; Then I created a new image from that using the starcluster ebimage<br>
&gt; command, and used vagrant (with the aws plugin) and chef to<br>
&gt; provision an instance of that image according to my needs and to<br>
&gt; change ubuntu&#39;s password.<br>
&gt;<br>
&gt; I&#39;m wondering if there are startup daemons, or NFS, or something,<br>
&gt; that somehow resets the /etc/passwd file or explicitly resets<br>
&gt; ubuntu&#39;s password?<br>
&gt;<br>
&gt; Thanks,<br>
&gt; Dan<br>
&gt;<br>
&gt; ----- Original Message -----<br>
&gt; &gt; From: &quot;Rayson Ho&quot; &lt;<a href="mailto:raysonlogin@gmail.com">raysonlogin@gmail.com</a>&gt;<br>
&gt; &gt; To: &quot;Dan Tenenbaum&quot; &lt;<a href="mailto:dtenenba@fhcrc.org">dtenenba@fhcrc.org</a>&gt;<br>
&gt; &gt; Cc: <a href="mailto:starcluster@mit.edu">starcluster@mit.edu</a><br>
&gt; &gt; Sent: Tuesday, June 17, 2014 1:31:07 PM<br>
&gt; &gt; Subject: Re: [StarCluster] problem modifying starcluster AMI -<br>
&gt; &gt; ubuntu password change does not persist<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; What tools did you use to create the AMI? Did you use the web<br>
&gt; &gt; console<br>
&gt; &gt; or you use the StarCluster command?<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; If you use the SC ebsimage command, then did you change your<br>
&gt; &gt; password<br>
&gt; &gt; on the image host?<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; Rayson<br>
&gt; &gt;<br>
&gt; &gt; ==================================================<br>
&gt; &gt; Open Grid Scheduler - The Official Open Source Grid Engine<br>
&gt; &gt; <a href="http://gridscheduler.sourceforge.net/" target="_blank">http://gridscheduler.sourceforge.net/</a><br>
&gt; &gt; <a href="http://gridscheduler.sourceforge.net/GridEngine/GridEngineCloud.html" target="_blank">http://gridscheduler.sourceforge.net/GridEngine/GridEngineCloud.html</a><br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; On Tue, Jun 17, 2014 at 3:17 PM, Dan Tenenbaum &lt; <a href="mailto:dtenenba@fhcrc.org">dtenenba@fhcrc.org</a><br>
&gt; &gt; &gt;<br>
&gt; &gt; wrote:<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; Hello,<br>
&gt; &gt;<br>
&gt; &gt; This might sound like an EC2 question that has nothing to do with<br>
&gt; &gt; starcluster, and in fact I have asked it on some AWS forums<br>
&gt; &gt; (there&#39;ve been no answers). However, I have never encountered this<br>
&gt; &gt; problem before until I started modifying a starcluster AMI, so I<br>
&gt; &gt; wonder if it is related to what&#39;s on that AMI.<br>
&gt; &gt;<br>
&gt; &gt; I made a custom AMI based on the starcluster AMI ami-3393a45a<br>
&gt; &gt; (us-east-1 starcluster-base-ubuntu-13.04-x86_64 (EBS))).<br>
&gt; &gt;<br>
&gt; &gt; I installed a bunch of additional software and I also set the<br>
&gt; &gt; password of the ubuntu user to (let&#39;s say) &#39;foobar&#39;.<br>
&gt; &gt;<br>
&gt; &gt; The reason I did that is that I installed a web app that uses unix<br>
&gt; &gt; usernames and passwords for authentication. So I needed the ubuntu<br>
&gt; &gt; user to have a known password.<br>
&gt; &gt;<br>
&gt; &gt; I then made a new image based on my running instance. Then I<br>
&gt; &gt; started<br>
&gt; &gt; a new instance from that image.<br>
&gt; &gt; I ssh&#39;d to that instance as the ubuntu user and typed &#39;passwd&#39;. I<br>
&gt; &gt; was<br>
&gt; &gt; prompted for my existing password and entered &#39;foobar&#39;. I then got:<br>
&gt; &gt;<br>
&gt; &gt; passwd: Authentication token manipulation error<br>
&gt; &gt; passwd: password unchanged<br>
&gt; &gt;<br>
&gt; &gt; This tells me that the password for ubuntu is not &#39;foobar&#39;.<br>
&gt; &gt;<br>
&gt; &gt; Another way to test this is to try &#39;su - ubuntu&#39;. This prompts for<br>
&gt; &gt; the password, I enter &#39;foobar&#39; and it says &quot;su: Authentication<br>
&gt; &gt; failure&quot;.<br>
&gt; &gt;<br>
&gt; &gt; So...in a nutshell, when I change the ubuntu password, this change<br>
&gt; &gt; does not survive the process of creating a new AMI.<br>
&gt; &gt;<br>
&gt; &gt; Could this be due to the way the starcluster AMI is configured? Is<br>
&gt; &gt; there some script that runs when it boots that re-sets that<br>
&gt; &gt; password? I&#39;m not passing any user-data when I start the<br>
&gt; &gt; instance.....(I also tried a crontab @reboot job that changes the<br>
&gt; &gt; password and that didn&#39;t work either....so maybe whatever is<br>
&gt; &gt; messing<br>
&gt; &gt; me up is happening after that job is run).<br>
&gt; &gt;<br>
&gt; &gt; Thanks,<br>
&gt; &gt; Dan<br>
&gt; &gt; _______________________________________________<br>
&gt; &gt; StarCluster mailing list<br>
&gt; &gt; <a href="mailto:StarCluster@mit.edu">StarCluster@mit.edu</a><br>
&gt; &gt; <a href="http://mailman.mit.edu/mailman/listinfo/starcluster" target="_blank">http://mailman.mit.edu/mailman/listinfo/starcluster</a><br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; _______________________________________________<br>
&gt; StarCluster mailing list<br>
&gt; <a href="mailto:StarCluster@mit.edu">StarCluster@mit.edu</a><br>
&gt; <a href="http://mailman.mit.edu/mailman/listinfo/starcluster" target="_blank">http://mailman.mit.edu/mailman/listinfo/starcluster</a><br>
&gt;<br>
</div></div></blockquote></div><br></div>