AWS Lightsail WordPress – connect to database on instance using mysqli

//Params to connect to a database $dbHost = “*static ip of wordpress site*”; This should be $dbHost = “localhost”; instead, or “127.0.0.1” (or even “::1”). localhost uses a separate virtual network interface that makes sure traffic between services on your Linux VM doesn’t leave the VM In general it’s safer to use localhost rather than … Read more

Why is SSH password authentication a security risk?

There are pro’s and con’s for either pw or key-based authentication. In some cases, for example, key-based authentication is less secure than password authentication. In other cases, its pw-based that’s less secure. In some cases, one is more convenient, in others, less. It all boils down to this: When you do key-based authentication, you must … Read more

Ansible stuck on gathering facts

I was having a similar issue with Ansible ping on Vagrant, it just suddenly stuck for no reason and has previously worked absolutely fine. Unlike any other issue like ssh or connective issue, it just forever die with no timeout. One thing I did to resolve this issue is to clean ~/.ansible directory and it … Read more

Why Block Port 22 Outbound?

I don’t see that anyone has spelled out the specific risk with SSH port forwarding in detail. If you are inside a firewall and have outbound SSH access to a machine on the public internet, you can SSH to that public system and in the process create a tunnel so that people on the public … Read more

What is the benefit of not allocating a terminal in ssh?

The primary difference is the concept of interactivity. It’s similar to running commands locally inside of a script, vs. typing them out yourself. It’s different in that a remote command must choose a default, and non-interactive is safest. (and usually most honest) STDIN If a PTY is allocated, applications can detect this and know that … Read more