title: Create a sudo user in script with no prompt for password, change to user without interrupting script
body: <p>This is what I'm trying to do in a script. It works here manually, but prompts me for a password. How do I:</p>
  
  <ol>
  <li>Create a new user</li>
  <li>With sudo privs</li>
  <li>Switch to that user</li>
  <li><p>Continue executing the rest of the script </p>
  
  <pre><code>sudo adduser centos
  sudo passwd centos
  usermod -aG wheel centos
  sudo su centos
  </code></pre></li>
  </ol>
  
  <p>I have tried the following but in Centos 7 bash, --disabled-password and -gecos both say "option not found."</p>
  
  <pre><code>adduser --disabled-password --gecos "" username
  </code></pre>