Dimas Maulana

Dimas Maulana

Developer

Welcome to my website! I am a developer with a current focus on React and Go. My experience encompasses both front-end and back-end development, enabling me to design and develop seamless and efficient applications.

Change Default Form Root When Sending Email From Mail or Mailx

In order to change the default sender name when sending an email using the mail or mailx command, you can follow these steps. This will allow you to replace the default “root” with your desired name. Please note that these instructions are typically applicable to Unix-like systems such as Linux.

  1. Change the Full Name:

    To change the full name associated with your user account, you can use the chfn (change finger) command. Open your terminal and run the following command, replacing "Your Full Name" with the name you want to use as the sender:

Change From Value on Cron Email

Certainly! To update a cron task and customize the email sent from it, you can use the following command with the <CRON COMMAND> replaced by your actual command:

1
<CRON COMMAND> | mail -E -s "Subject" -r "CUSTOM FORM NAME <[email protected]>"

This command will execute <CRON COMMAND> and send the output as an email with the specified subject and sender address.

Here’s a breakdown of the command:

  • <CRON COMMAND>: Replace this with the actual command you want to run on a schedule using cron.

Silence Result of Command

When you want to silence the result of a command in a Unix-like shell environment, you can use the > /dev/null or 2> /dev/null redirection techniques, depending on whether you want to suppress standard output (stdout) or standard error (stderr) respectively. Here’s how you can use them:

  • To silence standard output (stdout) of a command, use > /dev/null:

    1
    
    command > /dev/null

    This will discard the normal output of the command.

Fail2ban Block SSH Public Key Connection Attempt

You want to configure for Fail2ban to block SSH public key connection attempts using a custom filter and jail configuration. This setup is designed to identify and block IP addresses that attempt to make SSH key-based connections and fail authentication multiple times. Let’s break down your configuration step by step.

Jail Configuration (jail.local)

In your jail.local configuration, you have defined a custom jail section for SSH key-based authentication:

How to Configure Fail2Ban to Send Email Notifications When Banning IP Addresses

Fail2Ban is a powerful tool for protecting your server against brute-force attacks by banning IP addresses that repeatedly fail authentication attempts. While it can efficiently ban these IPs, you might also want to receive email notifications when such bans occur. This guide will walk you through configuring Fail2Ban to send email notifications when it bans an IP address.

Prerequisites

Before you begin, ensure you have the following:

How to Use Fail2Ban to Block Laravel Auth Attempts and Other Auth/Login URL Access

Fail2Ban is a valuable security tool that can help protect your server from unauthorized access attempts, including those targeting Laravel’s authentication system. In this article, we’ll guide you through setting up Fail2Ban to block authentication attempts and access to the /auth/login URL.

Prerequisites

Before we get started, make sure you have the following prerequisites in place:

0%