title: Proftpd - SFTP with Virtual Users
body: <p>I'm trying to configure a SFTP with Proftpd. I've successfully configured the SFTP with Unix Users, but now I'd like to use virtual users, as I'll have an important amount of users to add/delete.
  I want the users to login with username/password.</p>
  
  <p>For this, I've first followed the tutorial <a href="http://sysadmin.smile.fr/post/2012/09/18/Using-SFTP-with-ProFTPd" rel="noreferrer">Using SFTP with ProFTPd</a> then tried others.</p>
  
  <p>Here is the configuration for the SFTP server :</p>
  
  <pre><code>Include /etc/proftpd/modules.conf
  
  
  ServerName                      "Nom du FTP"
  ServerType                      standalone
  DefaultServer                   on
  
  # Umask 022 is a good standard umask to prevent new dirs and files
  # from being group and world writable.
  Umask                           022
  
  # To prevent DoS attacks, set the maximum number of child processes
  # to 30.  If you need to allow more than 30 concurrent connections
  # at once, simply increase this value.  Note that this ONLY works
  # in standalone mode, in inetd mode you should use an inetd server
  # that allows you to limit maximum number of processes per service
  # (such as xinetd).
  MaxInstances                    30
  
  RequireValidShell               off
  
  # Set the user and group under which the server will run.
  User                            proftpd
  Group                           nogroup
  
  SFTPEngine         on
  
  Port               2222
  SFTPLog            /var/log/proftpd/sftp.log
  TransferLog        /var/log/proftpd/sftp-xferlog
  
  # Host Keys
  SFTPHostKey        /etc/ssh/ssh_host_rsa_key
  SFTPHostKey        /etc/ssh/ssh_host_dsa_key
  
  # Auth methods
  SFTPAuthMethods    password
  AuthUserFile       /etc/proftpd/sftp.passwd
  AuthGroupFile      /etc/proftpd/sftp.group
  
  # SFTP specific configuration
  DefaultRoot        ~
  
  # Normally, we want files to be overwriteable.
  &lt;Directory /&gt;
    AllowOverwrite                on
  &lt;/Directory&gt;
  </code></pre>
  
  <p>I've generated the passwords using the command <code>ftpasswd --hash</code>.</p>
  
  <p>But, when I try to connect using FileZilla, I've got the message :</p>
  
  <pre><code>Authentification failed
  Critical error
  Can't establish a connection to the server
  </code></pre>
  
  <p>When I look into the logs of proftpd :</p>
  
  <pre><code>2014-09-08 15:13:53,636 mod_sftp/0.9.9[6343]: error using DisplayLogin 'welcome.msg': No such file or directory
  
  2014-09-08 15:13:53,637 mod_sftp/0.9.9[6343]: sent server version 'SSH-2.0-mod_sftp/0.9.9'
  
  2014-09-08 15:13:53,704 mod_sftp/0.9.9[6343]: received client version 'SSH-2.0-PuTTY_Local:_Jun__1_2014_11:08:49'
  
  2014-09-08 15:13:53,704 mod_sftp/0.9.9[6343]: handling connection from SSH2 client 'PuTTY_Local:_Jun__1_2014_11:08$
  
  2014-09-08 15:13:53,711 mod_sftp/0.9.9[6343]:  + Session key exchange: diffie-hellman-group-exchange-sha256
  
  2014-09-08 15:13:53,711 mod_sftp/0.9.9[6343]:  + Session server hostkey: ssh-rsa
  
  2014-09-08 15:13:53,711 mod_sftp/0.9.9[6343]:  + Session client-to-server encryption: aes256-ctr
  
  2014-09-08 15:13:53,711 mod_sftp/0.9.9[6343]:  + Session server-to-client encryption: aes256-ctr
  
  2014-09-08 15:13:53,711 mod_sftp/0.9.9[6343]:  + Session client-to-server MAC: hmac-sha2-256
  
  2014-09-08 15:13:53,711 mod_sftp/0.9.9[6343]:  + Session server-to-client MAC: hmac-sha2-256
  
  2014-09-08 15:13:53,711 mod_sftp/0.9.9[6343]:  + Session client-to-server compression: none
  
  2014-09-08 15:13:53,711 mod_sftp/0.9.9[6343]:  + Session server-to-client compression: none
  
  2014-09-08 15:13:54,142 mod_sftp/0.9.9[6343]: sending acceptable userauth methods: password
  
  2014-09-08 15:13:56,764 mod_sftp/0.9.9[6343]: sending userauth failure; remaining userauth methods: password
  
  2014-09-08 15:13:56,764 mod_sftp/0.9.9[6343]: client sent SSH_MSG_IGNORE message (160 bytes)
  
  2014-09-08 15:13:56,832 mod_sftp/0.9.9[6343]: error reading from client (fd 0): Connection reset by peer
  
  2014-09-08 15:13:56,832 mod_sftp/0.9.9[6343]: disconnecting client (Connection reset by peer)
  </code></pre>
  
  <p>I don't understand why it doesn't work.
  If I simply delete the lines :</p>
  
  <pre><code>AuthUserFile       /etc/proftpd/sftp.passwd
  AuthGroupFile      /etc/proftpd/sftp.group
  </code></pre>
  
  <p>The connection works perfectly with the Unix users.
  Have I forgotten anything ?</p>
  
  <p>I'm using Ubuntu server 14.04.</p>