Reputation: 637
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'
sudo lampp restart
and it workedsudo lampp security
, and I created some passwordssudo lampp restart
again, but this time i got the error messagethe 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).
Upvotes: 2
Views: 4463
Reputation: 19
For those who have a problem with this method, I found it on the internet some time ago, don't remember the source, (by the way, the solution is for Linux, but there may be an equivalent for Windows, windows users should google it).
1 - Install apache2-utils:
sudo apt install apache2-utils
2 - Generate credentials
htpasswd -nd myuser
3 - It will ask for a password and it will encrypt it, appearing the result and showing it on the screen in format: user:encryptedpassword
4 - Copy the encrypted password and open the file: $LAMP_DIR/etc/proftpd.conf
5 - Locate the lines with problem:
UserPassword daemon <?
function make_seed() { etc...
And replace it with (the username and encrypted password generated by the htpasswd command):
UserPassword myuser encryptedpassword
I hope it helps you as well as me.
Upvotes: 0
Reputation: 86
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"
Upvotes: 7
Reputation: 11
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."
#";
#?>
Upvotes: 1