2023-11

FreeBSD14_en

FreeBSD14 ; Mail Server(Postfix,Dovecot) , SSL/TLS

1. Obtaining a certificate for the mail server Obtain a certificate for the mail server to convert the mail server to SSL/TLS. Use the certbot that was used when the web server was converted to SSL. Stop the web server and execute the following command
FreeBSD14_en

FreeBSD14 ; WEB Server(Apache2) , MySQL8

1. Apache2 1.1 Install # cd /usr/ports/www/apache24 # make config There are many options, but we will proceed wit 1. Apache2 1.1 Install # cd /usr/ports/www/apache24 # make config There are many options, but we will proceed wit
FreeBSD14_en

FreeBSD14 ; FTP Server , Samba Fileserver

1. FTP Server(Vsftpd) 1.1 advance preparation ①Private Key Creation # cd /etc/ssl # openssl genrsa -des3 -out server.key 2048 Generating RSA private key, 2048 bit long modulus (2 primes) .........................................................................................................................................+++++ .................................................+++++ e is 65537 (0x010001) Enter pass phrase for server.key: Verifying - Enter pass phrase for server.key: Enter PEM pass phrase: Verifying - Enter PEM pass phrase:
FreeBSD14_en

FreeBSD14 ; Initial setup (Vim , SSH , firewall, NTP server)

1. Vim Install Install Vim, which you are familiar with as an editor, as follows # pkg install -y vim Edit the ".shrc" to make Vim available as the standard editor, and log in again to reflect the change. FreeBSD14 has sh as default shell. You can check the current SHELL with the following command
FreeBSD14_en

FreeBSD14 ; Initial setting (Update binaries, Packages and Ports Collection)

First do the following After installing FreeBSD, we will start building the server, but it is difficult to work on the console screen, so we will change the SSH connection settings for now in order to operate the server from Windows using TeraTerm or other software. Enter the following command on the FreeBSD console screen # vi /etc/ssh/sshd_config Line 61. #PasswordAuthentication no → PasswordAuthentication yes Make the changes and reflect the settings with the following command # service sshd restart Now you can connect via SSH from TeraTerm on Windows (see the default settings for other operating systems for settings in TeraTerm).
FreeBSD14_en

FreeBSD14.0 ; OS INSTALL

FreeBSD FreeBSD is UNIX-like open source OS software. In particular, its performance as a network operating system exceeds that of Linux-based systems, and it maintains stable performance even under high loads. FreeBSD is designed to be robust and sturdy with an emphasis on practicality, making it suitable for operating FTP, WWW, and e-mail servers for major companies and services. In this project, we will install FreeBSD 14.0, released on Nov 14, 2023, and build the server. Features High-speed, high-performance multi-platform capable of withstanding high workloads Adopted by many major companies Network security measures can be applied by restricting access Capable of operating small to large servers More than 33,000 dedicated software applications from commercial to personal use
fedora39_en

Fedora39 ; WEB Server(Apache2)

Apache2 installation and virtual host configuration 1.Apache2 Install Digest authentication in Apache2 Since Basic Authentication, a well-known authentication authentication method for http, transmits 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 the authentication information and sends it in encrypted form, so there is almost no risk of information leakage. ①httpd Install 3.Virtual Host Settings Assign and configure the [FQDN] to be operated on the virtual host in the document root [/var/www/html/FQDN] directory PHP installation and configuration 1.PHP Install
fedora39_en

Fedora39 ; Remote connection with SSH public key cryptography

1.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. The creation of a public/private key pair is performed with the authority of the user logging in remotely. If you do not specify the creation destination and file name, id_ed25519 and id_ed25519.pub will be created in /home/(user name)/.ssh/. On the way, also enter the password for the key
fedora39_en

Fedora39 ; SSH 、Firewalld

1.Remote connection by SSH SSH is a service for connecting remotely to a server, basically running immediately after OS installation, but the default settings are somewhat insecure. Configure the default settings to increase the security of ssh connections. 1.1 SSH service configuration file changes The SSH service configuration file is "/etc/ssh/sshd_config". Open the configuration file in a vi editor.
fedora39_en

Fedora39 ; Various settings after installation

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 invalidated in many cases. You can disable it by doing the following。
fedora39_en

Fedora39 ; SSL Certificate Acquisition( Let's Encrypt ) , Apache SSL , Mail SSL/TLS

1.Obtain an SSL certificate ( Let's Encrypt ) Install the latest open ssl # dnf install openssl-devel 1.1 advance preparation 1.Package management system Snappy installed Since the SSL certificate issuing tool "certbot" of Let's Encrypt is recommended to be installed using "snap" after 2021, install Snapd first.(Can also be installed the traditional way with dnf or yum) 2. Converting Apache to https Install the following just in case # dnf -y install mod_ssl 3. SSL/TLS (Let's Encrypt) settings on the mail server 3.1 Obtaining a certificate for the mail server Obtain 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.
AlmaLinux8.8_en

AlmaLinux8.8 ; Snort3+Snortsnarf , Chkrootkit Install

Snort3+Snortsnarf Install Implement Snort, a network-based IDS, in the unauthorized access detection system. SnortSnarf will also be installed to enable the unauthorized access logs extracted by Snort to be checked on a Web browser. AlmaLinux8 does not have a Snort3 repository, so build, compile and install Snort3 from source code Advance preparation ①Install required build tools and libraries Install the EPEL repository and enable the Powertools repository. chkrootkit ①Download and install chkrootkit # cd /usr/local/src # wget ftp://ftp.chkrootkit.org/pub/seg/pac/chkrootkit.tar.gz # tar xvf chkrootkit.tar.gz ➁Create /root/bin directory and move chkrootkit command to that directory # mkdir -p /root/bin # mv chkrootkit-0.58b/chkrootkit /root/bin ➂Check chkrootkit.
FreeBSD14_en

FreeBSD14 ; Web Server SSL、Webmin

1. Web server (Apache) SSL conversion The ports can be further updated with FreeBSD's periodic job settings. Install certbot via pkg, and include a plugin for apache to update in webroot mode. 1.1 Installing the Certbot tool for Let's Encrypt Run the following command to install the Certbot package and the Apache HTTP plug-in
FreeBSD14_en

FreeBSD14 ; Postfix ClamAV + Amavis + SpamassAssin

Install ClamAV on FreeBSD 14 and link it with Amavis against Postfix. ClamAV is anti-virus software. We will proceed on the assumption that you have already implemented Postfix. Before proceeding, update the Ports Collection. 1. ClamAV 1.1 Install # cd /usr/ports/security/clamav # make install clean Each option is installed by default for now clamav version check
fedora39_en

Fedora39 ; Mysql8 , WordPress Install

Mysql8 Install # dnf -y install mysql-server charset.cnf   Create a new one with the following contents WordPress Install 1. Create database for Word Press As an example, assume database [wp_db] database user [wp_user] password [?W123456]