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

nuy

Debian12.5_en

Debian12.5 : Let's Encrypt, WEB/Mail Server SSL

1. Obtain a certificate (Let's Encrypt)1.1 advance preparation①Enable mod_ssl# a2enmod ssl2. SSL/TLS (Let's Encrypt) configuration for Apache2①Edit Apache2 SSL-related configuration files3. SSL/TLS (Let's Encrypt) settings on the mail server3.1 Obtaining a certificate for the mail serverObtain a certificate for the mail server, but it cannot be obtained in the same way as above, so the following with the "--standalone" option fails.
Debian12.5_en

Debian12.5 : Anti-virus(Clamav) 、Mail Server

1.Antivirus software Clamav installedInstall Clam AntiVirus, a free anti-virus software for Linux, as an anti-virus measure.By installing this anti-virus software, you can not only scan the entire server for viruses, but also scan incoming and outgoing mail for viruses if you build and configure a mail server.2. Mail server installationPostfix was developed as a Mail Transport Agent (MTA) to replace sendmail, and is a mail server that is highly compatible with sendmail, secure, easy to maintain, and fast.In addition, since Postfix only functions as an SMTP server for sending mail, the POP server Dovecot for receiving mail will be installed separately in the latter half.3 Applied ClamAV to mail server PostfixSet up Postfix and Clamav to work together to scan incoming and outgoing mail in real time.4 Apply spam checks to the mail server4.1 Spam checking using spamassassin and procmail①spamassassin and procmail installation
Debian12.5_en

Debian12.5 : WEB Server(Apache)

Web server Apache2 installationAllow http:80 and https:443 ports in UFW before installation3.  Apache2; Using Perl ScriptsEnable CGI to make Perl scripts available①Install Perl4 Apache2 : Using PHP Scripts①Install PHP5. Virtual Host SettingsCopy the default configuration file (file name is arbitrary, in this case vhost-yourdomain.conf as an example) and configure the virtual host6. Digest authentication with Apache2Since Basic Authentication, a well-known authentication authorization method for http, sends authentication information in plain text, there is a risk of ID and password leakage if the packet is intercepted.On the other hand, Digest Authentication encrypts and transmits authentication information, so there is almost no risk of information leakage.
Debian12.5_en

Debian12.5 : NTP ,FTP Server Installation

1. Install a time synchronization service NTP server# apt -y install chrony# vi /etc/chrony/chrony.conf# Lines 20-23.:Comment the default settings and add the NTP server for your time zone.#pool ntp.ubuntu.com     iburst maxsources 4#pool 0.ubuntu.pool.ntp.org iburst maxsources 1#pool 1.ubuntu.pool.ntp.org iburst maxsources 1#pool 2.ubuntu.pool.ntp.org iburst maxsources 2
Debian12.5_en

Debian12.5 : SSH connection using public key cryptography

Create a key pairCreate 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.
Debian12.5_en

Debian12.5 : SSH , Firewall Setting

1. SSH Service Security SettingsThe SSH service allows the root user to log in by default, and since the root user already knows the user name and can log in to the server with administrative privileges once the password is known, we will deny this setting.1.1 Creating a General UserIf you have created a general user when installing Debian, this procedure is not necessary.If the only user created on the server is root, remote login via SSH will not be possible, so if a user has not been created during OS installation, a user must be created in advance.Users can be created with the "useradd" command. The "-m" option creates a home directory and the "-p" option specifies the password.For example, to set "debianuser" as the user account name and "123456" as the password, execute the following
Ubuntu20.04_en

Ubuntu Server 20.04 : System Backup and Restore

1. System backup1.1 Backup under /var/www/html①Create the /var/www/system directory# mkdir /var/www/system②Create a script "backup_all.sh" under /var/www/system# vi /var/www/system/backup_all.shContents of the "backup_all.sh" script#!/bin/bash#===========================================================# : Environment initialization#===========================================================#Date processingTODAY=`/bin/date +%Y%m%d`DAY_AGO=`/bin/date --date '7day ago' +%Y%m%d`
Ubuntu20.04_en

Ubuntu Server 20.04 : Logwatch & Disk usage check scripts

1. Introduction of disk usage check scripts1.1 Script creation# cd /opt/script/# vi disk_capacity_check.shContents of disk_capacity_check.sh#!/bin/bash#Specify email address for notificationMAIL=" "
Ubuntu20.04_en

Ubuntu Server 20.04 : SNORT , Tripwire install

1. Install SNORTSnort is an open source network intrusion detection system that can perform real-time traffic analysis and packet logging over IP networks.It can perform "protocol analysis", "content search" and "matching" and can be used to detect a variety of attacks such as "buffer overflows", "stealth port scans", "CGI attacks", "SMB probes", "OS fingerprinting attempts", "semantic URL attacks" and "server message block probes".
Ubuntu20.04_en

Ubuntu Server 20.04 : MySQL 8 , WordPress

1. Install MySQL 81. Install# apt -y install mysql-server-8.02. MySQL server security settingsRun the tool mysql_secure_installtion to configure security-related settings for your MySQL server.When you run it, you will be asked a series of questions to help you configure your security settings.You will first be asked if you want to use a password validation plugin, as shown below.Password validation means that you can check the password strength of users for MySQL and restrict them to accepting only passwords that are secure enough.For example, it should be at least a few characters long and always contain at least one symbol and one number.Type y if you like and press Enter
Ubuntu20.04_en

Ubuntu Server 20.04 : Apache, Mail and FTP server SSL (Let's Encrypt)

Instructions on how to get a certificate and apply it to apache, mail server, FTP server and convert to SSL with Let's Encrypt.1. Get a certificate(Let's Encrypt)1.1 Advance preparation①Enable mod_ssl# a2enmod ssl②Install a client tool to obtain a Let's Encrypt certificate
Ubuntu20.04_en

Ubuntu Server 20.04 : Anti-virus & mail server

1. Introduction of Clamav anti-virus software1.1 Install# apt install clamav clamav-daemonClamav-related configuration files are installed in the /etc/clamav/ folder1.2 Update your virus definitions# freshclamThe above command will update the virus definitions, but if you get the following error, change the log settings and run it again
Ubuntu20.04_en

Ubuntu Server 20.04 : NTP , FTP , WEB server

2. Install the FTP server vsftpd①Install# apt install vsftpd②Open PORT 21 at UFW# ufw allow ftp# ufw reload③Configuration file changes3. Apache2 installationFirst allow port http:80 and port https:443 on UFW# ufw allow http# ufw allow https# ufw reload3.1 Install Apache 2
Ubuntu20.04_en

Ubuntu Server 20.04 : SSH Service & Firewall

1. SSH service security settingsThe SSH service allows root user login by default.Since the root user already knows the username, if the password is known, he can log in to the server with administrator rights.1.1 Creating a general userIf you have created a general user during the installation of Ubuntu 20, this step is not necessary.If the only user created on the server is root, you will not be able to log in remotely via SSH, so if you have not created a user when you installed the OS, you will need to create one beforehand.To create a user, use the "useradd" command.The "-m" option is used to create a home directory and the "-p" option is used to specify a password.For example, to set "ubuntuuser" as the user account name and "123456" as the password, you would run
Ubuntu20.04_en

Ubuntu Server : 20.04 Initial setup

1. Set the root password and use the SU commandIn the default Ubuntu configuration, the root user is disabled because no password is set.By setting a password for the root user, the traditional [su] command can be used for transitions$ sudo passwd root[sudo] password for ← Current user's passwordEnter new UNIX password: ← Enter the root user password to be setRetype new UNIX password: ← Enter your password againpasswd: password updated successfullySwitch to root user$ su -Password:2. Modernisation of the system