bookmark_borderERROR 1064 (42000) at line 1 – Passing MySQL Create User Arguments via SSH

I was recently building a script to help move things from one server to another and in the process stumbled into a very annoying problem when passing MySQL arguments to a remote server via SSH.

Desired outcome: Create a new user in a remote DB using SSH.

In practice, this should be extremely simple. If you do this on the server, you could execute a command like this:

mysql --user="root" --password="[pass]" --execute="create user 'testing'@'localhost' identified by '123';"

You would now have a new user in your database called testing and it’s password would be 123.

Continue reading “ERROR 1064 (42000) at line 1 – Passing MySQL Create User Arguments via SSH”

bookmark_borderTroubleshooting PHP-FPM Pool Setup: WordPress Requires FTP/SFTP User After Successful Configuration

This post assumes you have successfully installed PHP-FPM and have confirmed it is running on the server, and

# systemctl status php7.2-fpm.service
● php7.2-fpm.service - The PHP 7.2 FastCGI Process Manager
   Loaded: loaded (/lib/systemd/system/php7.2-fpm.service; enabled; vendor preset: enabled)
   Active: active (running) since Thu 2020-08-13 03:40:43 UTC; 14min ago

Configured on the site:

But still getting this:

The good news is you are actually pretty close, and it’s actually something you missed in your site config file.

Go back and verify the port you’re listening on (e.g., vim /etc/php/7.2/fpm/pool.d/[pool name].conf). For instance, in my case it was:

listen = 127.0.0.1:9001

But my Apache config was looking for:

<FilesMatch "\.php$">
SetHandler "proxy:fcgi://127.0.0.1:9000/"
</FilesMatch>

A simple update to:

<FilesMatch "\.php$">
SetHandler "proxy:fcgi://127.0.0.1:9001/"
</FilesMatch>

And a restart of the web server:

systemctl restart apache2.service

Should do the trick, and get you situated again.

bookmark_borderSSH Permission Denied on DD-WRT Router

DD-WRT is an OpenSource router firmware supported by most modern router systems. If you want to open the door to what you can do with your router, DD-WRT is the way to do it. It allows you to bypass the limitations your commercial router software introduces.

Ok, let’s cut to the chase..

Permission Denied Using SSH with DD-WRT

If you’re like me, you have probably hit a brick wall when trying to SSH into the router after it’s been imaged with DD-WRT.

Check All SSH Settings

There are two place you want to update SSHD settings. Navigate to the following location

Services > Services > Secure Shell

Here, you will enable the SSHD daemon.

Make note of the port you’re using, and select to use a password or key or both. This is pretty straight forward, in my scenario I selected to disable password login and use my public SSH key for security.

Snapshot of Secure Shell Panel on Services Page

Then, navigate here:

Administration > Management > Remote Access

Don’t ask me why, but here you will make sure that SSH Management is Enabled and that your port is set the same as the last page.

Snapshot of Remote Access Panel on Management Page

Now save, and reboot the machine to make sure the changes stick.

Verify Username is Correct

If you are still having an issue, and it looks something like this:

$ ssh admin@192.168.1.1

DD-WRT v3.0-r44048 std (c) 2020 NewMedia-NET GmbH

Release: 08/02/20

Board: Linksys WRT3200ACM

admin@192.168.1.1: Permission denied (publickey).

or, something like this:

$ ssh admin@192.168.1.1

ssh: connect to host 192.168.1.1 port 22: Network is unreachable

tony:public antonioperez$ ssh admin@192.168.1.1

DD-WRT v3.0-r44048 std (c) 2020 NewMedia-NET GmbH

Release: 08/02/20

Board: Linksys WRT3200ACM

admin@192.168.1.1’s password: 

Permission denied, please try again.

admin@192.168.1.1’s password: 

Permission denied, please try again.

admin@192.168.1.1’s password: 

But you swear you are using the same username and password you log into the GUI with, then it might be something a little more frustrating.

The user.

Update the user to root instead of whatever user you were using. In my case, I was testing with admin.

After updating the username to ROOT:

$ ssh root@192.168.1.1

DD-WRT v3.0-r44048 std (c) 2020 NewMedia-NET GmbH

Release: 08/02/20

Board: Linksys WRT3200ACM

Enter passphrase for key ‘/Users/antonioperez/.ssh/id_rsa’:

Tada! Like magic, it started working. I have no idea why this is, but I have successfully used this on three DD-WRT installations and it works every time.

Cheers

bookmark_borderBriefly unavailable for scheduled maintenance. Check back in a minute.

Every now and then, depending on what you’re doing, you might encounter this problem with your WordPress site. I often see it after running an update:

Continue reading “Briefly unavailable for scheduled maintenance. Check back in a minute.”

bookmark_borderActive Domain Error in GravityForms MailGun plugin

For whatever reason I have was having the hardest time getting the MailGun plugin for GravityForms to use my From Email domain in WordPress.

Every time I tried to update the settings, I’d get the following error:

Continue reading “Active Domain Error in GravityForms MailGun plugin”

bookmark_borderMySQL – ERROR 1819 (HY000): Your password does not satisfy the current policy requirements

If you run into this error it’s a strong indicator that the Password Validation Plugin is installed.

The quick and dirty way to fix this is to uninstall the plugin. You will need to be the root user in the database.

Continue reading “MySQL – ERROR 1819 (HY000): Your password does not satisfy the current policy requirements”

bookmark_borderRemoving Index.php From the URL Slug in WordPress

This post assumes you’re having a hard time removing the index.php file name from the URL slug of your WordPress site.

Looks like something like this:

defragged.org/index.php/%postname%

This means one of two things:

Continue reading “Removing Index.php From the URL Slug in WordPress”

bookmark_borderLets Encrypt: Unable to install the certificate

You’ve heard it’s important to install Let’s Encrypt (LE). You spin up your Ubuntu 18.04 machine and try to use https://certbot.eff.org/.

You run the command:

certbot –apache -d domain.com

You are greeted with:

Continue reading “Lets Encrypt: Unable to install the certificate”