How To Save iptables To Disk On Amazon Linux 2

Author: , Posted on Friday, July 21st, 2023 at 9:38:26am

I wanted to save the iptables list to disk, but got an error when I tried:

# service iptables save
The service command supports only basic LSB actions (start, stop, restart, try-restart, reload, force-reload, status). For other actions, please try to use systemctl.

The solution was to install the iptables-services package:

# yum install iptables-services -y
iptables-services.x86_64 0:1.8.4-10.amzn2.1.2


I was then able to save properly:

root@inbound2:/var/log # service iptables save
iptables: Saving firewall rules to /etc/sysconfig/iptables:[ OK ]

How To Fix Error “Wrong Fs Type, Bad Option, Bad Superblock” When Mounting a Filesystem

Author: , Posted on Friday, June 23rd, 2023 at 4:43:39pm

When trying to mount can XFS filestsen on an AWS instance, I got the error “mount: wrong fs type, bad option, bad superblock on /dev/sdh”

Examine the volume’s UUID with the xfs_db command:

shell> sudo xfs_db -c uuid /dev/nvme2n1

To fix the problem, you have two options…

Temporary Solution

Add nouuid mount option to temporarily ignore the duplicate validation:

shell> sudo mount -t xfs -o nouuid /dev/nvme2n1 /volumes/tmp

Permanent Solution

The xfs_admin command can permanently adjust the UUID for the volume:

How To Fix Error “Cannot open access to console, the root account is locked”

Author: , Posted on Friday, June 23rd, 2023 at 4:31:14pm

When trying to access the serial console on AWS, I got the following error:
Cannot open access to console, the root account is locked

Since I had edited /etc/fstab, the host would not boot.

The only way to fix this problem is to unmount the root volume from the affected instance, mount it on another node, edit the stab file, and reverse the process., ending up with that volume re-attached as root on the problem node

How To Fix Mouse Scrolls the Command Line History Instead of the Window Buffer in Terminal

Author: , Posted on Tuesday, May 23rd, 2023 at 8:23:49am

In the macOS Terminal, my mouse scroll wheel would magically start scrolling the command line history instead of the window buffer scroll bar on the right to show window history.

This happened when an SSH session was disconnected or timed out.

The fix is to run the reset command.

How To Enable SSH Login From OS X Yosemite 10.10.5 to macOS Ventura 13.3.1

Author: , Posted on Friday, May 19th, 2023 at 10:37:58am

I was unable to login from my old iMac running Yosemite to my new iMac running Ventura using RSA keys.

It turns out that RSA key support was disabled in Ventura.

To correct the problem, I added the following two lines to the bottom of BOTH /etc/ssh/ssh_config and /etc/ssh/sshd_config on the Ventura side:

Be sure to stop and start Remote Login under System Settings -> General -> Sharing

How To Fix SSH Permission Denied From macOS Ventura To Amazon Linux

Author: , Posted on Tuesday, May 9th, 2023 at 9:55:13am

I have been using RSA SSH keys forever to login to my various AWS EC2 instances.

With macOS Ventura 13.3.1 ssh failed with the “Permission Denied” error. Using ssh -vvv, I saw that the RSA key was now being rejected.

After much research, I decided to implement new keys on the client (Ventura) side using ed25519, like this:

I then placed the new contents into the ~/.ssh/authorized_keys files on the target nodes, and everything started working!

How To Get rsync To Work With macOS Ventura – Getting Error “Operation not permitted”

Author: , Posted on Friday, May 5th, 2023 at 12:59:06pm

I have a new iMac running macOS Ventura 13.3.1.

I tried to rsync some files from another host and got the following error:

In order to get rsync to have access to the hard drive in macOS Ventura, you need to add rsync and other programs to the Full Disk Access panel under Privacy & Security in System Settings.

First click on System Settings

Next locate Privacy & Security at the bottom of the same block as General in the left menu bar and click on it
Next, click on Full Disk Access
Then open a Finder window and navigate to the top-level ‘Macintosh HD’ and look for the usr directory, select it, then select bin. Finally, drag & drop the rsync command into the Full Disk Access window in true Apple style.
Finish adding all of the below commands and rsync will work

This is the list of files to add via Drag & Drop to the Full Disk Access panel under Privacy & Security:

R.I.P Gordon Lightfoot

Author: , Posted on Tuesday, May 2nd, 2023 at 7:14:02am

Born: November 17, 1938, Orillia, Canada
Died: May 1, 2023, Sunnybrook hospital, Toronto, Canada, 84 years old

How To Expand an EBS Volume After a Disk Resize on Amazon Linux

Author: , Posted on Monday, April 17th, 2023 at 9:51:50am

First, use the AWS Console to modify the volume to the desired size, in our example we want to go from 10GB to 25GB for the root filesystem

For a Xen ext4 root volume

For NVMe

First, use lsblk to see the raw partitions:

Note how the partition at 259:1 is only 20GB, while the entire disk at 259:0 is 40GB. A partition resize is required in this case.

For an EXT4 filesystem, use the resize2fs command instead:

For more information, please visit the AWS Docs:

How To Fix WordPress Gateway Timeout Errors Running Apache with PHP-FPM

Author: , Posted on Tuesday, April 11th, 2023 at 6:31:31pm


I was seeing the following error when trying to do a plugin update, and an error in my WordPress logs:

Update failed: 504 Gateway Timeout Gateway Timeout The gateway did not receive a timely response from the upstream server or application.

[Tue Apr 11 22:12:01.373709 2023] [proxy_fcgi:error] [pid 26878] (70007)The timeout specified has expired: [client] AH01075: Error dispatching request to : (polling), referer:

and getting variations of any of the following strings:

504 Gateway Timeout
HTTP 504
Gateway Timeout (504)
HTTP Error 504 – Gateway Timeout
Gateway Timeout Error