skip to Main Content

EDIT : the pbm is not that I used space in the password after all, so I changed the description

While trying to configure xampp, I ran into an error : fatal: unknown configuration directive 'function' on line 44 of '/opt/lampp/etc/proftpd.conf'

  1. first, I downloaded and installed xampp
  2. then, I ran the command sudo lampp restart and it worked
  3. third, I ran sudo lampp security, and I created some passwords
  4. I tried the command sudo lampp restart again, but this time i got the error message

the file in /opt/lampp/etc/proftpd.conf :

 40 # daemon gets the password "xampp"
 41 # commented out by xampp security
 42 #UserPassword daemon 2TgxE8g184G9c
 43 UserPassword daemon <?
 44     function make_seed() {
 45         list($usec, $sec) = explode(' ', microtime());
 46         return (float) $sec + ((float) $usec * 100000);
 47     }
 48     srand(make_seed());
 49     $random=rand();
 50     $chars="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz./";
 51     $salt=substr($chars,$random % 64,1).substr($chars,($random/64)%64,1);
 52     $pass=$argv[1];
 53     $crypted = crypt($pass,$salt);
 54     echo $crypted."
 55 ";
 56 ?>

if I comment all these lines, xampp starts and I can go to the web page localhost/phpmyadmin/, and there I wanted to change my password for a new one without single quotes, but it says I’m not allowed :

 MySQL said: Documentation
#1131 - You are using MariaDB as an anonymous user and anonymous users are not allowed to modify user settings

also, my password is in clear in this file /opt/lampp/phpmyadmin :

 38 /**
 39  * phpMyAdmin configuration storage settings.
 40  */
 41 
 42 /* User used to manipulate with storage */
 43 // $cfg['Servers'][$i]['controlhost'] = '';
 44 // $cfg['Servers'][$i]['controlport'] = '';
 45 $cfg['Servers'][$i]['controluser'] = 'pma';
 46 # commented out by xampp security
 47 #$cfg['Servers'][$i]['controlpass'] = '';
 48 $cfg['Servers'][$i]['controlpass'] = 'password_here';

I don’t know how to solve that.

I tried uninstalling everything and start all over again, but it didn’t fix it (I did it so i was certain of what I did).

2

Answers


  1. I changed the "proftpd.conf" file with the following code:

    UserPassword daemon lampp
    #UserPassword daemon <?
    #   function make_seed() {
    #       list($usec, $sec) = explode(' ', microtime());
    #       return (float) $sec + ((float) $usec * 100000);
    #   }
    #   srand(make_seed());
    #   $random=rand();
    #   $chars="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz./";
    #   $salt=substr($chars,$random % 64,1).substr($chars,($random/64)%64,1);
    #   $pass=$argv[1];
    #   $crypted = crypt($pass,$salt);
    #   echo $crypted."
    #";
    #?>
    
    Login or Signup to reply.
  2. what you actualy did for sudo lampp security it just generating this below little boilerplate about hash and salt, that passed in $LAMP_DIR/etc/proftpd.conf

    function make_seed() {
        list($usec, $sec) = explode(' ', microtime());
        return (float) $sec + ((float) $usec * 100000);
    }
    srand(make_seed());
    $random=rand();
    $chars="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz./";
    $salt=substr($chars,$random % 64,1).substr($chars,($random/64)%64,1);
    $pass=$argv[1];
    $crypted = crypt($pass,$salt);
    echo $crypted."
    ";
    

    that’s fine. just because your xampp php not compiled hash automaticaly to you, you can move for next step by adding php keyword after UserPassword $ftpuser <? kind like below:

    UserPassword daemon <?php
            function make_seed() {
                list($usec, $sec) = explode(' ', microtime());
    
            #bla-bla-bla
    

    dont forget in $pass=$argv[1]; just change with $pass="your password here";

    then run them with your php interpreter
    /opt/lampp/bin/php /opt/lampp/etc/proftpd.conf

    and viola

    # daemon gets the password "xampp"
    # commented out by xampp security
    #UserPassword daemon 2TgxE8g184G9c
    UserPassword daemon dAN1WkV7r2TsU
    
    # daemon is no normal user so we have to allow users with no real shell
    RequireValidShell off
    
    # daemon may be in /etc/ftpusers so we also have to ignore this file
    UseFtpUsers off
    dev@enigma:/opt/lampp$ 
    

    you’ve got your new passwd UserPassword $ftpuser dAN1WkV7r2TsU

    or you can just assign plain password with UserPassword $ftpuser "plain_pw_here"

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search