title: Amazon linux: Change default ec2-user when creating an ami image
body: <p>Im trying to create an ami image using amazon linux distro with a custom user/pass.
  What I did (manaualy): </p>
  
  <ul>
  <li>Lunch an amazon instance using amazon linux ami </li>
  <li>login with user <code>ec2-user</code></li>
  <li>Create a new user for example <code>admin</code></li>
  <li>Change password for user <code>admin</code></li>
  <li>Add user <code>admin</code> to wheel group: <code>usermod -aG wheel admin</code></li>
  <li>Add user <code>admin</code> to sudoers file: <code>sudo echo "admin ALL=NOPASSWD:ALL " &gt; /etc/sudoers.d/admin</code></li>
  <li>Permit ssh user/pass login in <code>/etc/sshd/sshd_config</code> <code>(PermitRootLogin yes
  )</code></li>
  <li>restart ssh service: <code>/etc/init.d/ssh restart</code></li>
  <li>When I try to login with user <code>admin</code> - success. But when creating a
  new ami image and lunch new instance from the newly created ami,
  loging via user <code>admin</code> or <code>ec2-user</code> - <code>Permission denied
  (publickey).</code>
  What am I missing!!</li>
  </ul>