業務用エアコン関連の技術情報、エラーコード、環境問題対策に関する別サイト「エアコンの安全な修理・適切なフロン回収」

nuy

Almalinux9.2_en

AlmaLinux9.2 ; Logwatch , DiCe , Disk Usage Check Script

Logwatch , DiCe , Disk Usage Check Script
Rocky Linux9.2_en

Rocky Linux9.2 ; Logwatch , DiCE , Disk Usage Check Script

1. Logwatch①Install# dnf install logwatch②Edit configuration file2. DiCEWhenever the global IP changes, which happens when the network is disconnected or the router is disconnected and rebooted, the dynamic DNS must be accessed to inform the user that the global IP has changed. DiCE does this automatically!3.Introduce disk usage check script3.1 Script Creation# cd /var/www/system# vi disk_capacity_check.sh
Rocky Linux9.2_en

Rocky Linux9.2 ; FTP Server , Samba File Server

1.FTP Server1. 1 Vsftpd Install# dnf -y install vsftpd1.2 Configure VsftpdSave the unedited vsftpd.conf with .bak3. File server installation with SambaBuild a file server with access rights that requires user authentication with Samba.Installation Procedure①Create shared folders with access rights that require user authentication②Accessible group creation③Creation of users belonging to accessible groups④Configuration File Editing
Rocky Linux9.2_en

Rocky Linux9.2 ; Suricata , Tripwire , Chkrootkit

SuricataSURICATA IDS/IPS is an open source IDS that monitors communications on the network and detects suspicious traffic.The basic mechanism is signature-based, so it can detect predefined unauthorized communications. Suricata is also characterized by its ability to provide protection as well as detection.1.advance preparation①Activate the EPEL RepositoryTripwire1.Installation# dnf install -y tripwireChkrootkit①Download and install chkrootkit
Rocky Linux9.2_en

Rocky Linux9.2 ; System Backup and Restore

1.Website data backup1-1.Backup under /var/www/html①Create backup script file# cd /var/www/system# vi backup_html.sh2.MySQL database backup①Create backup script file# cd /var/www/system# vi db_my_backup.sh3.Restore backup files under html①Store HTML backup files in "/ (root)" directory4.Restore Mysql backup file①Save the database backup file to any directory and(In the example, the directory is "/var/www/backup/db_bak".)Extracting data
Almalinux9.2_en

AlmaLinux9.2 ; MySQL8 , WordPress Install

Mysql8 , WordPress InstallWordPress Install1. Create database for Word PressAs an example, assume database [wp_db] database user [wp_user] password [?Ww123456]
Almalinux9.2_en

AlmaLinux9.2 ; Authenticated SSH connection with key pair

SSH connection with authentication using public key cryptography Create public and private key pairsCreate a public/private key pair for a user connecting to a Linux server using OpenSSH.Use ssh-keygen to create the key pair.The creation of a public/private key pair must be done as a user with remote login privileges.If you do not specify the destination and file name, id_ed25519 and id_ed25519.pub will be created in /home/(user name)/.ssh/. On the way, enter the password for the key.
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" commandBy 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
LinuxTips(RedHat)_en

Allowing users to belong to multiple groups

Group information in Linux is stored in the "/etc/group" file, which has the following notationtama:x:500:From left to right, tama is the group name, X is the password (when it says X, it is written in the /etc/gshadow file). 500 is the GID.To make a user belong to multiple groups, edit the "/etc/group" file, but it is convenient to use the vigr command to edit the "/etc/group" file. (The operation method is the same as vi)
LinuxTips(RedHat)_en

Execute commands with root privileges as an ordinary user.

When logging in as a regular user, use the sudo command to use commands with root privileges.By specifying the command you want to execute as the argument of the sudo command, you can execute the root command. As a prerequisite, when executing the sudo command, it is necessary to set the user you want to allow to execute in the /etc/sudoers file in advance.Also, the log of sudo command execution is written in a log file via the syslog daemon, and you can know in detail who used what command and when with the sudo command.
LinuxTips(RedHat)_en

Prevent other users from seeing the file.

In Linux, you can prevent other users from seeing a file by using the chmod command to change the file's permissions.Other users are other users who belong to the file's owner group, and other users.