Password problem with FTP users on slave in multiserver setup

Discussion in 'General' started by cbakken, May 8, 2020.

  1. cbakken

    cbakken New Member HowtoForge Supporter

    Generating new passwords for FTP users seems to work as expected, and does on the master server.
    On the slave server the passwords doesn't get updated, and I think I have found out why, after some testing and digging.
    The passwords are generated with SHA512 encryption, and is too long for the password column in the ftp_user table in dbispconfig on the slave:

    mysql> update ftp_user set password='$6$rounds=5000$5cab6612ec970bdb$Z.AIxZyRrIsVViEv2GC5P5dcbYf5KyvmUKM6m/TLda2tSrtEhiWaicKw/qbX1yIYtECnQYyA8podnUw2w.Pju.' where username='dadada';
    ERROR 1406 (22001): Data too long for column 'password' at row 1
    If I generate the same password manually with SHA256 and update the table on the slave, everything works as it should when connecting

    This probably occured with a failed ISPCConfig update some time ago.

    What is the best solution here?

  2. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    What kind of failure was it? Are both systems now updated properly?
    You make no mention of what version of ISPConfig is on master and slave, and what operating system is running on those.
  3. till

    till Super Moderator Staff Member ISPConfig Developer

    The password column in the ftp_user tabe should be varchar 200:

    `password` varchar(200) default NULL,
  4. cbakken

    cbakken New Member HowtoForge Supporter

    Taleman: I'm actually not sure exactly what happened, at the time I had my hands full getting it to work again, but I remember I got database errors and had to rebuild something. It could have been with the upgrade of Ubuntu 14.04LTS to 16.04LTS, I think this upgrade also switched from MySQL to MariaDB.
    ISPConfig Monitor on the master says Ubuntu 16.04.6 LTS (Xenial Xerus) ISPConfig 3.1.15p2 on both master and slave (although I have applied the latest patch to bring them up to 3.1.15p3).

    Till: So, I can use "ALTER TABLE ftp_user MODIFY password varchar(200) default NULL"? Can that be done "just like that", no other changes need to be made?

    Today I also tried to change the ftp username on an account at the slave, which also failed, but it could have been because I changed the password first, and then the update failed because of the password column problem.
  5. till

    till Super Moderator Staff Member ISPConfig Developer

    As long as you don't encounter any other issues, then changing the length of the password column should be enough.

Share This Page