![]() If you don’t have a LAMP stack already installed on your server, you can follow our guide here. Now we install it using the following command below: sudo dnf install One of the requirements for installing phpMyAdmin is installing the PHP-fedora-autoloader package. Now we run the following command to added EPEL and Remi repository to your system: sudo dnf install First, let’s start by ensuring your system is up-to-date. We recommend acting as a non-root sudo user, however, you can harm your system if you’re not careful when acting as the root. A non-root sudo useror access to the root user.SSH access to the server (or just open Terminal if you’re on a desktop).It’s recommended that you use a fresh OS install to prevent any potential issues.A server running one of the following operating systems: AlmaLinux 8 or Rocky Linux 8.Then, create a password file with a user named user1 using the htpasswd utility: htpasswd -c /etc/phpmyadmin/. htaccess file inside the phpMyAdmin root directory: nano /usr/share/phpmyadmin/.htaccess Save the file then restart the Apache service to apply the changes: systemctl restart apache2 htaccess file by editing the file nf: nano /etc/apache2/conf-available/nfĪdd the line AllowOverride All within the section: htaccess authentication and authorization functionalities.įirst, enable the use of. To do so, you should use Apache’s built-in. So you should take extra care to prevent unauthorized access. Secure phpMyAdmin on Ubuntu 20.04īecause of its popularity, phpMyAdmin is the first target for attackers. You should see the phpMyAdmin management interface in the following screen: 5. Provide your MySQL root username, password and click on the Go button. Now, open your web browser and access phpMyAdmin using the URL You will be redirected to the phpMyAdmin login page: Next, restart the Apache service to apply the changes: systemctl restart apache2Īt this point, phpMyAdmin is installed in your server. Provide your password and click on the Ok button to finish the installation. You will be asked to provide a MySQL application password for phpMyAdmin as shown below: You will be asked to configure a database for phpMyAdmin with dbconfig-common as shown below: Select the Apache web server and click on the Ok button. You can install it by running the following command: apt-get install phpmyadmin -yĭuring the installation, you will be asked to choose a web server as shown below: Install PhpMyAdmin from Ubuntu 20.04 repositoryīy default, phpMyAdmin is available in the Ubuntu 20.04 default repository. Now, exit from the MySQL shell with the following command: mysql> EXIT Īt this point, your MySQL server is configured to use mysql_native_password authentication method. You should see the following output: +-+-+ Next, verify the authentication method again with the following command: mysql> SELECT user,plugin FROM er Next, flush the privileges to apply the changes: mysql> FLUSH PRIVILEGES Now, change the authentication plugin from auth_socket to mysql_native_password for your root user with the following command: mysql> ALTER USER IDENTIFIED WITH mysql_native_password BY 'secure-password' | debian-sys-maint | caching_sha2_password | You should get the following output: +-+-+ ![]() To do so, login to MySQL shell with the following command: mysqlĪfter login, check the authentication method of all of your users run the following command: mysql> SELECT user,plugin FROM er So you will need to change this default authentication method from auth_socket to mysql_native_password in order to log in to phpMyAdmin as MySQL root user. Configure MySQL Serverīy default, the MySQL root user is set to authenticate using the auth_socket plugin by default rather than with a password in Ubuntu 20.04 running MySQL 5.7 or later versions. Once logged in, make sure that your server is up-to-date by running the following commands: apt-get update -yĪpt-get upgrade -y 2. Make sure to replace IP_ADDRESS and PORT_NUMBER with your actual server IP address and SSH port number. To connect to your server as the root user, use the following command: ssh -p PORT_NUMBER Install PhpMyAdmin from Ubuntu 20.04 repositoryīefore starting, you need to connect to your server via SSH as the root user or any other user with sudo privileges.
0 Comments
Leave a Reply. |