Click here for "Safe Air Conditioner Repair and Proper Freon Recovery".(Japanese Version)

nuy

Rocky Linux8.6 Building a server

Rocky Linux8.6 : SNORT ,Tripwire ,Chkrootkit

Install SNORT 1.advance preparation ①Add the CodeReady Red Hat repository and install the required software # dnf config-manager --set-enabled powertools Install Tripwire 1.Download and installation # cd /usr/local/src # wget https://rpmfind.net/linux/epel/8/Everything/x86_64/Packages/t/tripwire-2.4.3.7-5.el8.x86_64.rpm Install Chkrootkit ①Download and install chkrootkit # cd /usr/local/src # wget https://launchpad.net/chkrootkit/main/0.55/+d
Rocky Linux8.6 Building a server

Rocky Linux8.6 : MySQL ,WordPress Install

Install Mysql8 #dnf module -y install mysql:8.0 #vi /etc/my.cnf.d/charset.cnf Create a new charset.cnf with the following contents Install WordPress 1. Create database for Word Press As an example, assume database [wp_db] database user [wp_user] password [?W123456]
Rocky Linux8.6 Building a server

Rocky Linux8.6 : Logwatch ,Disk Usage Check Script

1. Logwatch ① Install # dnf install logwatch ② Edit configuration file # cat /usr/share/logwatch/default.conf/logwatch.conf >> /etc/logwatch/conf/logwatch.conf 2. Introduce disk usage check script 2.1 Scripting # cd /var/www/system
Rocky Linux8.6 Building a server

Rocky Linux8.6 : System Backup and Restore

1.Website data backup 1-1. Backup under /var/www/html ①Creating backup script files # cd /var/www/system # vi backup_html.sh 2. MySQL database backup ①Creating backup script files # cd /var/www/system 3. Restore backup files under html ① Store HTML backup files in "/ (root)" directory # cd /var/www/backup/html_bak # cp html_back_20220610.tar.gz /    ←Specify the backup file with the latest date 4. Restore Mysql Backup Files ①Save DB backup file to any directory (In the example, the directory is "/var/www/backup/db_bak") Extract data
Almalinux8.6 Building a server

AlmaLinux 8.6 : Initial Settings

1. SELinux Disable First, disable selinux. selinux is a feature that improves auditing and security in Linux, but when enabled, it can limit the behavior of services and the configuration considerably. Therefore, it is basically disabled in many cases. To disable SELinux, a reboot is required by adding selinux=0 to the kernel command line as follows 2. System Modernization Package updates are performed as soon as possible immediately after OS installation. However, when a dnf update is performed, a kernel update is also performed at the same time. A kernel update may require rebooting the system or stopping services, or worse, a kernel panic may occur and the system may not boot. It is wiser to exclude the kernel from the update.
Almalinux8.6 Building a server

AlmaLinux 8.6 : SSH , Firewall , NTP

1. Setting up SSH remote connection SSH is a service for connecting remotely to a server and is basically running immediately after the OS is installed, but the default settings are somewhat insecure. Here we will configure the default settings to increase the security of ssh connections. 2. How to set up a firewall (firewalld) In AlmaLinux, the firewall is set to firewalld by default and is enabled during OS installation. Briefly explaining "firewalld," when setting communication control policies, the method is to apply communication permission/blocking rules to predefined zones, and then assign those zones to each NIC (network adapter). 4. NTP Server Settings Synchronize server time with Japan Standard Time ① Chrony Installation and Configuration
Rocky Linux8.6 Building a server

Rocky Linux8.6 : SSH Public Key Cryptography Authentication

SSH connection with authentication using RSA public key cryptography Creation of public and private key pairs Create a public/private key pair for a user connecting to a Linux server using OpenSSH. Use ssh-keygen to create the key pair. This time, we will create a key set using the RSA cipher used in the SSH protocol Version 2. Creation of public/private key pairs is performed with remote login user privileges (huong). If you do not specify the destination and file name, id_rsa and id_rsa.pub will be created in /home/huong/.ssh/. On the way, enter the password for the key.
Almalinux8.6 Building a server

AlmaLinux 8.6 : Anti-Virus , Mail Server

Install clamav ( anti-virus software ) 1.Clam AntiVirus Install # dnf -y install clamav clamd clamav-update 2.Clam AntiVirus  Configuration File Editing Mail Server Installation 1.Postfix Installation 1.1 Install Install Postfix and build an SMTP server # dnf -y install postfix Mail Server : Postfix + Clamav + Amavisd+SpamAssassin 1.Real-time scanning of e-mails ①Amavisd & Clamav Server  Install
Almalinux8.6 Building a server

AlmaLinux 8.6 : MySQL8 , WordPress Install

Mysql8  Install # dnf module -y install mysql:8.0 # vi /etc/my.cnf.d/charset.cnf charset.cnf    Create a new one with the following contents WordPress  Install 1. Create a database for WordPress As an example, assume database [wp_db] database user [wp_user] password [?W123456] # mysql -u root -p
Almalinux8.6 Building a server

AlmaLinux 8.6 : System Backup and Restore

1. Website data backup 1-1. Backup under /var/www/html ①Create backup script file # cd /var/www/system # vi backup_html.sh 2. MySQL database backup ①Creating backup script files # cd /var/www/system 3.Restore backup files under html ① Store HTML backup files in "/" (root) directory # cd /var/www/backup/html_bak 4. Restore Mysql Backup Files ①Save the database backup file to any directory (In the example, the directory is "/var/www/backup/db_bak".) Unzip data
LinuxTips(RedHat)_en

Delete user

The command to delete a user is userdel. When this command is executed, the user information will be deleted, but the user's home directory will be left behind. If you want to delete the home directory as well, specify "-r" as an option and execute it.
LinuxTips(RedHat)_en

Changing user settings

The UID, GID, and home directory are specified in advance for the user. If you want to change these information later, use the usermod command. The usermod command can only be executed by root, and it allows you to change various user information. (It is also possible to change the user name).
LinuxTips(RedHat)_en

Create a user

To create and add a new user, use the "useradd" command By specifying a user name as an argument to the command, a user will be created. The user directory will be created under the /home directory, and the group name will be the same as the user name.
LinuxTips(RedHat)_en

Create a group

To create and add a new group, use the "groupadd" command. Information about groups is described in /etc/group and can be edited, but it is better to edit the group information with the vigr command instead of directly editing the "/etc/group" file.
LinuxTips(RedHat)_en

Check the groups to which a user belongs.

Check the group in /etc/passwd and /etc/group (check the gid) Users always belong to a group, and the group described in the /etc/passwd and /etc/group files is the primary group. The gid (group ID) is stored in the /etc/passwd and /etc/group files