title: giving ftp user a random password
body: <p>So I'm trying to create a new ftp user and directory and give him only permissions for that directory. But the problem is when setting a password for created user. It creates user but i get this when i try to set a password for him</p>
  
  <blockquote>
    <p>Creating home directory <code>/home/kwgazl69' ... Copying files from</code>/etc/skel' ... Enter new UNIX password: passwd: user 'test123' does not exist</p>
  </blockquote>
  
  <p>What am i doing wrong ? Here is the code</p>
  
  <pre><code>$src = $request-&gt;path;
  $dest = "/home/$randomNum/serverFiles";
  
  echo $ssh-&gt;exec("adduser --force-badname $randomNum");
  echo $ssh-&gt;exec("passwd test123");
  
  echo $ssh-&gt;exec("cp -r $src $dest");
  echo $ssh-&gt;exec("usermod -d $dest $randomNum");
  
  echo $ssh-&gt;exec("cd $dest &amp;&amp; ./samp03svr");
  
  $ssh-&gt;disconnect();
  </code></pre>
  
  <blockquote>
    <p>Adding user <code>ln2i78yt' ... Adding new group</code>ln2i78yt' (1010) ... Adding new user <code>ln2i78yt' (1010) with group</code>ln2i78yt' ... Creating home directory <code>/home/ln2i78yt' ... Copying files from</code>/etc/skel' ... Enter new UNIX password: passwd: unrecognized option '--stdin' Usage: passwd [options] [LOGIN] Options: -a, --all report password status on all accounts -d, --delete delete the password for the named account -e, --expire force expire the password for the named account -h, --help display this help message and exit -k, --keep-tokens change password only if expired -i, --inactive INACTIVE set password inactive after expiration to INACTIVE -l, --lock lock the password of the named account -n, --mindays MIN_DAYS set minimum number of days before password change to MIN_DAYS -q, --quiet quiet mode -r, --repository REPOSITORY change password in REPOSITORY repository -R, --root CHROOT_DIR directory to chroot into -S, --status report password status on the named account -u, --unlock unlock the password of the named account -w, --warndays WARN_DAYS set expiration warning days to WARN_DAYS -x, --maxdays MAX_DAYS set maximum number of days before password change to MAX_DAYS</p>
  </blockquote>