Fedora35:データベース設定

MariaDB の インストール

MariaDB をインストールします。

[root@www ~]# dnf -y install mariadb-server

MariaDB を設定します。

[root@www ~]# vi /etc/my.cnf.d/mariadb-server.cnf

[mysqld]に追記します。

[mysqld]
character-set-server=utf8

起動します。

[root@www ~]# systemctl start mariadb

自動起動設定します。

[root@www ~]# systemctl enable mariadb

初期設定します。

[root@www ~]# mysql_secure_installation

下記の表示後、「Enter」を押下します。

Enter current password for root (enter for none):

root パスワードを設定します。

Set root password? [Y/n] y
New password:
Re-enter new password:

「y」で応答します。

Remove anonymous users? [Y/n] y

「y」で応答します。

Disallow root login remotely? [Y/n] y

「y」で応答します。

Remove test database and access to it? [Y/n] y

「y」で応答します。

Reload privilege tables now? [Y/n] y

MariaDBにrootユーザーで接続します。

[root@www ~]# mysql -u root -p
Enter password:

ユーザー情報一覧を表示します。

MariaDB [(none)]> select user,host,password from mysql.user;
+------+-----------+-------------------------------------------+
| user | host      | password                                  |
+------+-----------+-------------------------------------------+
| root | localhost | ***************************************** |
| root | 127.0.0.1 | ***************************************** |
| root | ::1       | ***************************************** |
+------+-----------+-------------------------------------------+
3 rows in set (0.00 sec)

データベース一覧を表示します。

MariaDB [(none)]> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
+--------------------+
3 rows in set (0.00 sec)

終了します。

MariaDB [(none)]> exit

phpMyAdmin のインストール

httpdをインストールしておきます。

PHP をインストールしておきます。

phpMyAdminをダウンロードし、解凍します。

[root@www ~]# dnf -y install phpMyAdmin php-mysqlnd php-mcrypt php-php-gettext

phpMyAdminを設定します。

[root@www ~]# vi /etc/httpd/conf.d/phpMyAdmin.conf

13行目:アクセス許可IPを追記します。

Require ip 127.0.0.1 192.168.1.1/24

19行目:アクセス許可IPを追記します。

Require ip 127.0.0.1 192.168.1.1/24

再起動します。

[root@www ~]# systemctl restart httpd

Webブラウザを起動し、「http://fedoraserver.jp/phpmyadmin/」にアクセスし、登録したユーザーで認証してログインします。(管理画面から MariaDB を操作することができます。)

phpmyadmin

Fedora35:Webサーバー設定

httpdのインストール

httpd をインストールします。

[root@www ~]# dnf -y install httpd

ウェルカムページを削除します。

[root@www ~]# rm -f /etc/httpd/conf.d/welcome.conf

httpd の設定します。

[root@www ~]# vi /etc/httpd/conf/httpd.conf

100行目:行頭の「#」を削除してコメント解除し、サーバー名を指定します。

ServerName fedoraserver.jp:80

156行目:変更します。

AllowOverride All

169行目:ディレクトリ名のみでアクセスできるファイル名を追記します。

DirectoryIndex index.html index.cgi index.php index.rb index.py

321行目:コメントアウトして文字化け対応します。

#AddDefaultCharset UTF-8

ドキュメントルート所有者を編集ユーザー(webmaster)に変更します。

[root@www ~]# chown webmaster. /var/www/html/

ドキュメントルート所有者を確認します。

[root@www ~]# ll /var/www/
合計 0
drwxr-xr-x 2 root root 6 4月 24 22:46 cgi-bin
drwxr-xr-x 2 webmaster webmaster 6 4月 24 22:46 html

URLのwwwを設定します。

[root@www ~]# vi /etc/httpd/conf.d/virtualhost-00-fedoraserver.jp.conf

wwwなしに統一します。

<VirtualHost *:80>
    ServerName fedoraserver.jp
    DocumentRoot /var/www/html
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^www\.fedoraserver\.jp
    RewriteRule ^(.*)$ http://fedoraserver.jp/$1 [R=301,L]
</VirtualHost>

起動します。

[root@www ~]# systemctl start httpd

自動起動設定します。

[root@www ~]# systemctl enable httpd

HTMLテストページを作成します。

[root@www ~]# vi /var/www/html/index.html
<html>
<body>
<div style="width: 100%; font-size: 20px; font-weight: bold; text-align: center;">
Test Page
</div>
</body>
</html>

Webブラウザを起動し、「http://fedoraserver.jp」にアクセスし、動作確認をします。
Webブラウザを起動

TCP80番ポート開放

ルーターの設定で、TCP80番ポートを開放します。(設定方法はご自身の環境に合わせて調べてください。

ポート開放テスト

開放確認サイトで「ホスト名(linuxserver.jp)」、「ポート番号(80)」の開放確認をします。

Perlのインストール

Perl をインストールします。

[root@www ~]# dnf -y install perl perl-CGI

「html」ディレクトリで CGI の実行を許可する設定します。

[root@www ~]# vi /etc/httpd/conf.d/html.conf

拡張子 cgi、pl、rb、py を CGI として設定します。

<Directory "/var/www/html">
    Options +ExecCGI
    AddHandler cgi-script .cgi .pl .rb .py
</Directory>

「/usr/local/bin/perl」で、Perlコマンドへアクセスできるようにします。

[root@www ~]# ln -s /usr/bin/perl /usr/local/bin/perl

Perlのパスを確認します。

[root@www ~]# whereis perl
perl: /usr/bin/perl /usr/local/bin/perl /usr/share/man/man1/perl.1.gz

再起動します。

[root@www ~]# systemctl restart httpd

CGIテストページを作成します。

[root@www ~]# vi /var/www/html/index.cgi
#!/usr/bin/perl

print "Content-type: text/html\n\n";
print "<html>\n<body>\n";
print "<div style=\"width: 100%; font-size: 20px; font-weight: bold; text-align: center;\">\n";
print "CGI Test Page";
print "\n</div>\n";
print "</body>\n</html>\n";

パーミッションを設定します。

[root@www ~]# chmod 705 /var/www/html/index.cgi

Webブラウザを起動し、「http://fedoraserver.jp/index.cgi」にアクセスし、動作確認をします。

Webブラウザを起動

PHPのインストール

PHP をインストールします。

[root@www ~]# dnf -y install php php-mbstring php-pear

PHP を設定します。

[root@www ~]# vi /etc/php.ini

923行目:行頭の「;」を削除してコメント解除し、自身のタイムゾーンを追記します。

date.timezone = "Asia/Tokyo"

再起動します。

[root@www ~]# systemctl restart httpd

PHPテストページを作成します。

[root@www ~]# vi /var/www/html/index.php
<html>
<body>
<div style="width: 100%; font-size: 20px; font-weight: bold; text-align: center;">
<?php
print "PHP Test Page";
?>
</div>
</body>
</html>

Webブラウザを起動し、「http://fedoraserver.jp/index.php」にアクセスし、動作確認をします。

Webブラウザを起動

Rubyのインストール

Ruby をインストールします。

[root@www ~]# dnf -y install ruby

再起動します。

[root@www ~]# systemctl restart httpd

Rubyテストページを作成します。

[root@www ~]# vi /var/www/html/index.rb
#!/usr/bin/ruby

print "Content-type: text/html\n\n";
print "<html>\n<body>\n";
print "<div style=\"width: 100%; font-size: 20px; font-weight: bold; text-align: center;\">\n";
print "Ruby Test Page";
print "\n</div>\n";
print "</body>\n</html>\n";

パーミッションを設定します。

[root@www ~]# chmod 705 /var/www/html/index.rb

Webブラウザを起動し、「http://fedoraserver.jp/index.rb」にアクセスし、動作確認をします。

Webブラウザを起動

Perlモジュールのインストール

CPANを起動します。

[root@www ~]# perl -MCPAN -e shell

「y」を入力して「Enter」キー押下します。

Would you like to configure as much as possible automatically? [yes] y

チェックを入れて「OK」をクリックするとインストールログが表示されます。

モジュール名 説明
全て
Jcode 日本語文字コードの変換
Getopt::Long コマンドライン引数のオプションを処理する
Archive::Tar tarファイルの展開と作成(v5.10以降)
Cwd カレントディレクトリのパスを取得する
File::Basename ファイルのベース名とディレクトリ名の取得
File::Copy ファイルの移動とコピー
File::Path 複数階層のディレクトリの作成と削除
File::Spec ファイル名に対する移植性のある処理
File::Temp 一時ファイルの作成
File::Find ファイルの検索
FindBin スクリプトが存在するディレクトリのパスの取得
Encode 日本語などのマルチバイト文字列を適切に処理する
utf8 ソースコード内の文字列を内部文字列に変換
Carp モジュールの呼び出し元の観点で例外を発生させる
lib モジュールの検索パスの追加
Time::Piece 日付・時刻を扱うための標準モジュール(v5.10からコアモジュール)
Time::Local localtime,gmtimeの逆返還
base クラスの継承
Data::Dumper 変数の内容を出力する
Benchmark ベンチマーク(性能比較)を行う
JSON JSONデータの解析
MIME::Base64 Base64形式へのエンコード
MIME::QuotedPrint quoted-printable形式へのエンコード
Digest::MD5 MD5値を求める
Digest::SHA 各種SHA値を求める (v5.10以降)
Storable データのシリアライズ化
Scalar::Util スカラ値に関するユーティリティ
List::Util 配列に対するさまざまな操作
Hash::Uti ハッシュのキーの制限
Sys::Hostname ホスト名の取得
Net::FTP FTPクライアント
Net::Ping リモートホストの生存確認
Exporter 関数のエクスポート
CPAN CPANからモジュールをインストールする
Pod::Usage PODドキュメントの出力
Errno システムのエラー番号をあらわす定数
POSIX POSIXで定義された関数
Math::BigInt 大きな数の計算
Math::BigFloat 大きな数の計算
Mojolicious Webフレームワーク
Mojolicious::Plugin::AutoRoute ルートを自動的に生成
MIME::Lite メールを簡単に送信
Class::Accessor::Fast アクセサの作成
Object::Simple デフォルト値つきのアクセサの作成
DDP データをく出力する
DBIx::Custom データベース簡単操作
MySQL::Diff MySQLの差分を表示
DateTime 日付の汎用的な処理
PDL 統計解析
Imager 画像編集
Text::CSV::Encoded 日本語を含んだCSVファイルを取り扱う
Text::Diff テキストの差分確認
XML::Simple シンプルなXMLパーサ
Validator::Custom HTMLフォームの検証
Data::Page ページング処理の支援
Data::Page::Navigation ページのナビゲーションの作成
Module::Starter モジュールの雛形を作成する
Devel::NYTProf 使いやすいプロファイラ
perltidy ソースコードの整形
Net::Ping::External pingコマンドの実行
IO::ScalarArray 標準入力の自動試験
IO::Capture 標準出力、標準エラー出力の自動試験
FFI::Raw ダイナミックライブラリ内の関数を呼び出す
Math::Trig さまざまな三角関数
FFI::Platypus 機能豊富なFFIモジュール
Time::Moment 日付・時刻の高速な処理
CGI CGIモジュール
CGI::Carp HTTPD(またはその他)にエラーログを書込む
DBI 各種データベースをアクセスする
strict 文法チェックを厳しくする
LWP::UserAgent Web 上のデータに アクセスする
LWP::Protocol::https LWP::UserAgentでSSLに アクセスする
Net::SSLeay LWP::UserAgentでSSLに アクセスする
Net::SSL LWP::UserAgentでSSLに アクセスする
Crypt::SSLeay LWP::UserAgentでSSLに アクセスする
Encode::Guess 文字コードを判別
Image::ExifTool Exifの情報を取得する
Archive::Tar tar 展開、作成、ファイルの追加
Image::Magick ImageMagick のコマンドラインツール
Archive::Zip zip 展開、作成、ファイルの追加

モジュールをインストールします。

[root@www ~]# 

ImageMagikのインストール

ImageMagickをインストールします。

[root@www ~]# dnf -y install ImageMagick

perl ImageMagickをインストールします。

[root@www ~]# dnf -y install ImageMagick-perl

サーバー証明書の取得

Certbotをインストールします。

[root@www ~]# dnf -y install certbot

証明書を取得します。

ドキュメントルート:/var/www/html/

メールアドレス:webmasterfedoraserver.jp

Webサーバー名:fedoraserver.jp

[root@www ~]# certbot certonly --webroot -w /var/www/html/ -m webmaster@fedoraserver.jp  -d fedoraserver.jp --agree-tos

証明書自動更新を設定します。

[root@www ~]# vi /etc/cron.d/letsencrypt

下記を追記します。

00 16 * * 2 root /usr/bin/certbot renew --post-hook "service httpd restart"

SSLの設定

SSLをインストールして、暗号化通信ができるように設定します。

[root@www ~]# dnf install mod_ssl

SSLを設定します。

[root@www ~]# vi /etc/httpd/conf.d/ssl.conf

59行目:行頭の「#」を削除してコメントを解除します。

DocumentRoot "/var/www/html"

75行目:行頭の「#」を削除してコメントを解除し、変更します。

SSLProtocol -All +TLSv1 +TLSv1.1 +TLSv1.2

101行目:取得した証明書を指定します。

SSLCertificateFile /etc/letsencrypt/live/fedoraserver.jp/cert.pem

109行目:取得した鍵ファイルを指定します。

SSLCertificateKeyFile /etc/letsencrypt/live/fedoraserver.jp/privkey.pem

118行目:行頭の「#」を削除してコメント解除し、取得した中間証明書を指定します。

SSLCertificateChainFile /etc/letsencrypt/live/fedoraserver.jp/chain.pem

再起動します。

[root@www ~]# systemctl restart httpd

Free Monitoring Test Toolsで「https://fedoraserver.jp」の作動確認をします。

Fedora35:セキュリティ対策

アンチウィルスソフトの導入(Clam AntiVirus)

Clam AntiVirus をインストールします。

[root@www ~]# dnf -y install clamav clamav-update

Clam AntiVirus を設定します。

[root@www ~]# vi /etc/freshclam.conf

8行目:行頭に「#」を追記してコメント化します。

#Example

パターンファイルを更新します。

[root@www ~]# freshclam
ClamAV update process started at Sun Jun 30 23:51:01 2019
main.cvd is up to date (version: 58, sigs: 4566249, f-level: 60, builder: sigmgr)
daily.cld is up to date (version: 25496, sigs: 1606212, f-level: 63, builder: raynman)
bytecode.cvd is up to date (version: 328, sigs: 94, f-level: 63, builder: neo)

スキャンを実行して動作確認します。

[root@www ~]# clamscan --infected --remove --recursive /home

----------- SCAN SUMMARY -----------
Known viruses: 6163086
Engine version: 0.101.2
Scanned directories: 38
Scanned files: 23
Infected files: 0
Data scanned: 0.00 MB
Data read: 0.00 MB (ratio 0.00:1)
Time: 179.738 sec (2 m 59 s)

テスト用無害ウィルスをダウンロードします。

[root@www ~]# wget http://www.eicar.org/download/eicar.com

スキャンを実行して動作確認します。

[root@www ~]# clamscan --infected --remove --recursive .

----------- SCAN SUMMARY -----------
Known viruses: 6163097
Engine version: 0.101.2
Scanned directories: 3
Scanned files: 10
Infected files: 1
Data scanned: 0.00 MB
Data read: 0.00 MB (ratio 0.00:1)
Time: 179.738 sec (2 m 59 s)

ファイル改竄検知システムの導入(Tripwire)

Tripwire をインストールします。

[root@www ~]# dnf -y install tripwire

Tripwire の初期設定をします。

[root@www ~]# tripwire-setup-keyfiles

サイトキーファイルのパスフレーズを設定します。

Enter the site keyfile passphrase: サイトキーファイルのパスフレーズ(英数字)
Verify the site keyfile passphrase: サイトキーファイルのパスフレーズ(英数字)

ローカルキーファイルのパスフレーズを設定します。

Enter the local keyfile passphrase: ローカルキーファイルのパスフレーズ(英数字)
Verify the local keyfile passphrase: ローカルキーファイルのパスフレーズ(英数字)

サイトキーファイルのパスフレーズを入力します。

Please enter your site passphrase: サイトキーファイルのパスフレーズ

サイトキーファイルのパスフレーズを入力します。

Please enter your site passphrase: サイトキーファイルのパスフレーズ

「/etc/tripwire」へディレクトリを移動します。

[root@www ~]# cd /etc/tripwire

初期設定をします。

[root@www tripwire]# vi twcfg.txt

12行目:報告レベルを最大に変更します。

REPORTLEVEL = 4

設定ファイルを生成します。

[root@www tripwire]# twadmin -m F -c tw.cfg -S site.key twcfg.txt

サイトキーファイルのパスフレーズを入力します。

Please enter your site passphrase: サイトキーファイルのパスフレーズ
Wrote configuration file: /etc/tripwire/tw.cfg

ポリシーを最適化します。

[root@www tripwire]# vi twpolmake.pl

行頭に「#」が自動挿入される場合は2回に分けて作成します。

#!/usr/bin/perl
# Tripwire Policy File customize tool
# ----------------------------------------------------------------
# Copyright (C) 2003 Hiroaki Izumi
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# ----------------------------------------------------------------
# Usage:
# perl twpolmake.pl {Pol file}
# ----------------------------------------------------------------
#
#ここまでを1回目で作成して行頭に「#」の無い行を作成して、以下をコピペします。
$POLFILE=$ARGV[0];

open(POL,"$POLFILE") or die "open error: $POLFILE" ;
my($myhost,$thost) ;
my($sharp,$tpath,$cond) ;
my($INRULE) = 0 ;

while (<POL>) {
    chomp;
    if (($thost) = /^HOSTNAME\s*=\s*(.*)\s*;/) {
        $myhost = `hostname` ; chomp($myhost) ;
        if ($thost ne $myhost) {
            $_="HOSTNAME=\"$myhost\";" ;
        }
    }
    elsif ( /^{/ ) {
        $INRULE=1 ;
    }
    elsif ( /^}/ ) {
        $INRULE=0 ;
    }
    elsif ($INRULE == 1 and ($sharp,$tpath,$cond) = /^(\s*\#?\s*)(\/\S+)\b(\s+->\s+.+)$/) {
        $ret = ($sharp =~ s/\#//g) ;
        if ($tpath eq '/sbin/e2fsadm' ) {
            $cond =~ s/;\s+(tune2fs.*)$/; \#$1/ ;
        }
        if (! -s $tpath) {
            $_ = "$sharp#$tpath$cond" if ($ret == 0) ;
        }
        else {
            $_ = "$sharp$tpath$cond" ;
        }
    }
    print "$_\n" ;
}
close(POL) ;

[root@www tripwire]# perl twpolmake.pl twpol.txt > twpol.txt.new
[root@www tripwire]# twadmin -m P -c tw.cfg -p tw.pol -S site.key twpol.txt.new

サイトキーファイルのパスフレーズを入力します。

Please enter your site passphrase: サイトキーファイルのパスフレーズ
Wrote configuration file: /etc/tripwire/tw.pol

データベースを作成します。

[root@www tripwire]# tripwire -m i -s -c tw.cfg

ローカルキーファイルのパスフレーズを入力します。

Please enter your local passphrase: ローカルキーファイルのパスフレーズ

ディレクトリを戻ります。

[root@www tripwire]# cd

チェックを実行します。(定期チェックは日次でチェック実行されます。)

[root@www ~]# tripwire -m c -s -c /etc/tripwire/tw.cfg
Open Source Tripwire(R) 2.4.2.2 Integrity Check Report

Report generated by:          root
...
...
...
All rights reserved.

チェック結果を確認します。

[root@www ~]# ll /var/lib/tripwire/report
total 4
-rw-r--r-- 1 root root 1821526 6月 29 07:58 server.jp-20190629-075230.twr
-rw-r--r-- 1 root root 1830182 6月 30 06:09 server.jp-20190630-060029.twr
-rw-r--r-- 1 root root 1829590 7月 1 09:29 server.jp-20190701-092314.twr
-rw-r--r-- 1 root root 1828518 7月 1 17:27 server.jp-20190701-171400.twr

レポートを指定してデータベースを更新します。

[root@www ~]# tripwire -m u -a -s -c /etc/tripwire/tw.cfg -r /var/lib/tripwire/report/server.jp-20190701-171400.twr

ローカルキーファイルのパスフレーズを入力します。

Please enter your local passphrase: ローカルキーファイルのパスフレーズ

rootkit検知システム導入(RkHunter)

RKHunter をインストールします。

[root@www ~]# dnf -y install rkhunter

RKHunter の設定します。

[root@www ~]# vi /etc/sysconfig/rkhunter

レポートを送信する宛先とスキャンモードを設定します。

#レポートを送信する宛先
MAILTO=root@localhost
#スキャンモード
DIAG_SCAN=no

データベースをアップデートします。

[root@www ~]# rkhunter --update

システムのファイル情報をアップデートすます。

[root@www ~]# rkhunter --propupd

チェック実行します。

[root@www ~]# rkhunter --check --sk
[ Rootkit Hunter version 1.4.2 ]

Checking system commands...
...
...
No warnings were found while checking the system.

SSHサーバー公開鍵認証方式接続の設定

サーバーの公開鍵の作成

TeraTermを起動し、ユーザーでログインし公開鍵、秘密鍵を作成します。

[webmaster@www ~]$ ssh-keygen -t ecdsa

「Enter」を押下します。

Generating public/private ecdsa key pair.
Enter file in which to save the key (/home/webmaster/.ssh/id_ecdsa):

「パスフレーズ」を設定します。

Enter passphrase (empty for no passphrase):
Enter same passphrase again:

公開鍵を「.ssh/」へ転送します。

[webmaster@www ~]$ mv ~/.ssh/id_ecdsa.pub ~/.ssh/authorized_keys

ログイン設定を行います。

[webmaster@www ~]$ chmod 700 .ssh/

rootでログインして秘密鍵を「/samba/share」に転送します。

[root@www ~]# mv /home/webmaster/.ssh/id_ecdsa /samba/share
[root@www ~]# chmod 777 /samba/share/id_ecdsa

クライアントPCのSambaショートカットから「id_ecdsa」ファイルを任意の場所(SSH鍵/秘密鍵/)に保存します。

接続テスト

「新しい接続」を選択します。

新しい接続

「ホスト」にIPアドレスを入力して、「OK」をクリックします。

IPアドレス

「ユーザー名」、「パスフレーズ(鍵のパスフレーズ)」を入力します。

「ユーザー名」、「パスフレーズ(鍵のパスフレーズ)」を入力

「RSA/DSA/ECDSA/ED25519鍵を使う」を選択します。

RSA/DSA/ECDSA/ED25519鍵を使う

「秘密鍵」をクリックして、保存した「SSH鍵/秘密鍵/id_ecdsa」を選択します。

SSH鍵/秘密鍵/id_rsa

「OK」をクリックして接続を確認します。

「OK」をクリックして接続を確認

rootへログインします。

[webmaster@www ~]$ su -
パスワード:

「/etc/ssh/sshd_config」を編集して、秘密鍵での認証接続

バックアップを作成します。

[root@www ~]# cp -p /etc/ssh/sshd_config /etc/ssh/sshd_config_bck

編集します。

[root@www ~]# vi /etc/ssh/sshd_config

65行目:「yes」→「no」に変更します。

PasswordAuthentication no

SSHを再起動します。

[root@www ~]# systemctl restart sshd

Fedora35:ドメイン設定

DiCEのインストール

wget パッケージと glibc パッケージをインストールします。

[root@www ~]# dnf -y install wget
[root@www ~]# dnf -y install glibc

DiCE をダウンロードし、解凍します。

[root@www ~]# cd /usr/local/bin
[root@www bin]# wget https://rcg.jp/download/DiCE.tar.gz
[root@www bin]# tar xzvf DiCE.tar.gz
[root@www bin]# rm -f DiCE.tar.gz
[root@www bin]# cd

DiCE の設定

ライブラリをインストールします。

[root@www ~]# dnf install ld-linux.so.2

「y」で応答します。

Is this ok [y/d/N]: y

文字コードを「EUC-JP」に変更

「設定」→「端末」を選択します。

「設定」→「端末」を選択

「漢字-受信」、「漢字-送信」をEUCに変更し、「OK」をクリックします。

「漢字-受信」、「漢字-送信」をEUCに変更し、「OK」をクリック

セットアップします。

[root@www ~]# setarch `uname -m` /usr/local/bin/DiCE/diced
=-=-=- DiCE DynamicDNS Client -=-=-=
Version 0.19 for Japanese
Copyright(c) 2001 sarad

:setup
IPアドレスの検出方法を指定してください
(0) 自動検出
(1) ローカルのネットワークアダプタから検出
(2) 外部のスクリプトから検出
<現在:0>
(N)変更しない  (P)戻る
>2
-------------------------------------------------
スクリプトのURLを入力してください
<現在:>
(N)変更しない (P)戻る
>http://dyn.value-domain.com/cgi-bin/dyn.fcg?
-------------------------------------------------
プライベートIPアドレスも検出対象ですか? (Y/N)
<現在:いいえ>
(P)戻る
>N
-------------------------------------------------
IPアドレスの検出をテストしますか? (Y/N)
(P)戻る
>Y
検出IPアドレス>***.***.***.*** 
上記の検出IPアドレスが表示しない場合の確認はこちら、IPアドレス確認
-------------------------------------------------
IPアドレスの検出をテストしますか? (Y/N) 
(P)戻る 
>N
-------------------------------------------------
IPアドレスをチェックする間隔を指定してください(分)
設定可能範囲は5分以上です
<現在:60>
(N)変更しない  (P)戻る
>5
=================================================
DNSサーバーの負荷を軽減するために頻繁なDNS更新を防ぐ必要があります
前回の更新から一定時間DNS更新処理を行わないように保護時間を設定して
ください(分)  設定可能範囲は10分から1440分です
<現在:60>
(N)変更しない  (P)戻る
>10
=================================================
設定を保存しますか? (Y/N)
(P)戻る
>Y
設定を保存しました
=================================================

DiCEイベントの追加

ドメイン(VALUE DOMAIN)に合わせて設定します。

:add
新しくイベントを追加します

DynamicDNSサービス名を入力してください
"?"で対応しているサービスを一覧表示します
(P)戻る
>?
           ZENNO.COM            livedoor            MyDNS.JP
              pcc.jp              JPN.ch             MyIP.US
              @nifty         StaticCling            MyServer
             ddns.ca                 p2p      did.expoze.com
              Dynamx          WebReactor               unicc
               Earth              DNS2Go              instat
              Now.nu           dynDNS.it          onamae.com
                DION                 ODN         RegisterFly
                 DHS          Netservers                todd
                 USA                 cjb              Dyn.ee
             BIGLOBE                dnip             3domain
             miniDNS           my-domain            ZoneEdit
                ZiVE                  yi                ysdn
              theBBS            SelfHOsT              ddo.jp
               No-IP             nicolas                eNom
           CyberGate            EveryDNS           Microtech
            ieServer          HAMMERNODE             GetmyIP
               Dynup                Dynu                dyns
              DynDSL            DynDNSdk              dyndns
               DtDNS                dnsQ                 dhs
             DDNS.nu            cheapnet            changeIP
            ARTofDNS         VALUEDOMAIN                 ODS
              JSPEED               IPDYN            DnsTokyo
=================================================
新しくイベントを追加します


ホスト名を入力してください
(P)戻る
>VALUEDOMAIN
=================================================
ドメイン名を入力してください
"?"でドメイン一覧を表示します
(P)戻る
>ドメイン名
=================================================
ホスト名を入力してください
(P)戻る
>*
=================================================
ログインユーザ名を入力してください
(P)戻る
>
=================================================
ログインパスワードを入力してください
(P)戻る
>ログインパスワード
=================================================
登録するIPアドレスを入力してください
空白にすると現在のIPアドレスを自動検出します
(P)戻る
>
=================================================
このイベントに題名を付けてください
(P)戻る
>VALUEDOMAIN-ドメイン名

このイベントを実行するスケジュールを設定します
-------------------------------------------------
実行する頻度を指定してください (番号入力)
(0)1回のみ (1)1日1回 (2)1週間に1回 (3)1ヵ月に1回
(4)その他の周期 (5)IPアドレス変化時 (6)起動時
(P)戻る
>4
-------------------------------------------------
実行する周期を指定してください
<現在:9>
(0)3分毎   (1)5分毎   (2)10分毎  (3)30分毎
(4)1時間毎 (5)2時間毎 (6)6時間毎 (7)12時間毎
(8)24時間毎(9)7日毎   (10)14日毎 (11)21日毎
(12)28日毎 (13)35日毎 (14)56日毎 (15)84日毎
(N)変更しない  (P)戻る
>0
=================================================
=================================================
このイベントを有効にしますか? (Y/N)
(イベントの有効/無効は"EN/DIS"コマンドで切替えられます)
>Y
=================================================
イベントを保存しますか? (Y/N)
>Y
イベント"VALUE-DOMAIN-server.jp"を保存しました
=================================================
:

転送を有効化して終了します。

:ex 0
+ 4/8 17:00 にVALUEDOMAIN-server.jpが実行されました
  IPアドレスを更新しました
:quit

「漢字-受信」、「漢字-送信」をUTF-8に変更し、「OK」をクリックします。

「漢字-受信」、「漢字-送信」をUTF-8に変更し、「OK」をクリック

その他の方法

IPアドレス更新スクリプトを作成します。

[root@www ~]# vi /usr/local/bin/update_ip_script.sh
#!/bin/bash

# Store your domain, password, hostname, and current IP address in variables
DOMAIN=${1}
PASS=${2}
HOST=${3}

# Store URLs and values in variables
IPINFO_URL="http://ipinfo.io/ip"
VD_UPDATE_BASE_URL="http://dyn.value-domain.com/cgi-bin/dyn.fcg"
NS_SERVER="ns1.value-domain.com"  # Store the DNS server address

DOMAIN_LOG="d"
PASS_LOG="p"
HOST_LOG="h"
CURRENTIP_LOG="i"

if [ "${HOST}" = "" ]; then
    FQDN=${DOMAIN}
else
    FQDN="${HOST}.${DOMAIN}"
fi

# Error Messages
ERROR_MSG_VDIP="Error detecting IP address configured in VALUE-DOMAIN settings"
ERROR_MSG_CURRENTIP="Error detecting current IP address"
UPDATE_SUCCESS_MSG="IP address update successful"
UPDATE_ERROR_MSG="IP address update error"
EMAIL_SUBJECT="IP address update error"

# Obtain IP address configured in VALUE-DOMAIN settings
IPGETLOG=`host ${FQDN} ${NS_SERVER} 2>&1`
VDIP=`echo "${IPGETLOG}" | grep "has address" | awk '{ print $NF }' | egrep ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$`
if [ $? -ne 0 ]; then
    echo "${FQDN} ${ERROR_MSG_VDIP}" | logger -t $(basename $0)
    echo ${IPGETLOG} | logger -t $(basename $0)
    exit
fi

# Obtain current IP address
IPGETLOG=`curl "${IPINFO_URL}" 2>&1`
echo "${IPGETLOG}" | egrep ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$ > /dev/null 2>&1
if [ $? -eq 0 ]; then
    CURRENTIP=`echo "${IPGETLOG}" | tail -n 1 | awk '{ print $NF }'`
else
    echo "${DOMAIN} ${ERROR_MSG_CURRENTIP}" | logger -t $(basename $0)
    echo "${IPGETLOG}" | logger -t $(basename $0)
    exit
fi

# Create URL query parameters
QUERY_PARAMS="${DOMAIN_LOG}=${DOMAIN}&${PASS_LOG}=${PASS}&${HOST_LOG}=${HOST}&${CURRENTIP_LOG}=${CURRENTIP}"

# Combine with the base URL for VALUE-DOMAIN update
VD_UPDATE_URL="${VD_UPDATE_BASE_URL}?${QUERY_PARAMS}"

# Update VALUE-DOMAIN configured IP address
# (Only if VALUE-DOMAIN configured IP address is different from current IP address)
if [ "${VDIP}" != "${CURRENTIP}" ]; then
    IPUPDATE=`wget -q -O - "${VD_UPDATE_URL}"`
    echo ${IPUPDATE} | grep -q OK
    if [ $? -eq 0 ]; then
        echo "${FQDN} ${UPDATE_SUCCESS_MSG} ${VDIP} to ${CURRENTIP}" | logger -t $(basename $0)
    else
        echo "${FQDN} ${UPDATE_ERROR_MSG}" | logger -t $(basename $0)
        echo ${IPUPDATE} | logger -t $(basename $0)
        (
        echo ${UPDATE_ERROR_MSG}
        echo ${IPUPDATE}
        ) | mail -s "${SCRIPT##*/}${EMAIL_SUBJECT}" root
        exit 1
    fi
fi
exit

IPアドレス更新スクリプトへ実行権限付加します。

[root@www ~]# chmod +x /usr/local/bin/update_ip_script.sh

IPアドレス更新スクリプトを実行します。

[root@www ~]# /usr/local/bin/update_ip_script.sh ドメイン パスワード "*"

IPアドレス更新スクリプトを定期自動実行ファイルを作成します。(3分毎に実行します。)

[root@www ~]# vi /etc/cron.d/ddns-update
*/3 * * * * root /usr/local/bin/update_ip_script.sh ドメイン パスワード "*"

Fedora35:NTPサーバー設定(Chrony)

NTPサーバー設定(Chrony)

Chrony をインストールして、時刻同期します。

[root@www ~]# dnf -y install chrony

Chronyを設定します。

[root@www ~]# vi /etc/chrony.conf

3行目: 行頭に「#」を追記してコメント解除し、時刻同期する NTP サーバーを追加します。

#pool 2.linuxserver.pool.ntp.org iburst
pool ntp.nict.jp iburst

24行目: ネットワークを追記します。

allow 192.168.1.1/24

自動起動を設定します。

[root@www ~]# systemctl enable --now chronyd

作動確認します。

[root@www ~]# chronyc sources
210 Number of sources = 4
MS Name/IP address Stratum Poll Reach LastRx Last sample
===============================================================================
^- ec2-13-230-38-136.ap-nor> 2 10 377 299 +3241us[+3241us] +/- 38ms
^* ntp-a2.nict.go.jp 1 10 377 478 +371us[ +563us] +/- 11ms
^- ntp-5.jonlight.com 2 10 377 236 +460us[ +460us] +/- 40ms
^- 122x215x240x51.ap122.ftt> 2 10 377 298 -957us[ -957us] +/- 40ms

Fedora35:バックアップ設定

バックアップ領域の作成

サーバーの電源を切ってHDD(メインHDDより容量の大きいもの)を追加しておきます。

Windows のリモートデスクトップ機能でサーバーに接続します。

「アクティビティ」→「アプリケーションを表示する」を選択します。

「ユーティリティ」を選択します。

「ディスク」を選択します。

「バックアップ用HDD」→「+」を選択します。

→「サイズを設定」→「名前を設定」→「作成」で初期バックアップ用(Defalt HDD Backup 20Gb)、システムバックアップ用(Sestem Backup)のパーティション作成します。

」をクリックしてマウントします。

自動バックアップの設定

アップデートします。

root@www:~# dnf update

timeshiftをインストールします。

root@www:~# dnf -y install timeshift

独自翻訳した日本語化ファイルを用意いたしました。

日本語化ファイル(timeshift.zip)をダウンロードし、解凍します。

解凍したファイル(timeshift.mo)をsambaのフォルダにコピーします。

「fedora」→「Share」にtimeshift.moをペーストします。

timeshift.moをペースト

Windows のリモートデスクトップ機能でサーバーに接続します。

「アクティビティ」→「ファイル」→「samba/share/timeshift.mo」をコピーします。

「アクティビティ」→「ファイル」→「usr/share/locale/ja/LC_MESSAGES」へ貼付けます。

「アクティビティ」→「アプリケーションを表示する」を選択します。

「Timeshift」を選択します。

「RSYNC」を選択し、「次」をクリックします。

「Sestem Backup」を選択し、「次」をクリックします。

「毎日」を選択し、「次」をクリックします。

「次」をクリックします。

「完了」をクリックします。

「設定」をクリックします。

「ユーザー」をクリックし、「すべてのファイルを含める」を選択し「OK」をクリックします。

「作成」をクリックしスナップショットを作成します。

(リモートディスクトップで復元できない場合はサーバーにログインして復元します。)

Fedora35:デスクトップ環境設定

デスクトップ環境インストール

デスクトップ環境をインストールします。

[root@www ~]# dnf -y group install "Basic Desktop" GNOME

デスクトップを起動します。

[root@www ~]# startx

ログイン設定をします。

[root@www ~]# systemctl set-default graphical.target
[root@www ~]# systemctl set-default
[root@www ~]# ll /etc/systemd/system/default.target

再起動します。

[root@www ~]# reboot

注意:VNCサーバーかXrdpサーバーのどちらか一つをインストールしてください。両方インストールすると表示できない場合があります。おすすめはXrdpサーバーです。

VNCサーバーの設定

VNCサーバーをインストールします。

root@www:~# dnf -y install tigervnc-server

VNC 接続を設定したいユーザーでログインし、VNC サーバーでパスワード(英数字8桁以内)を設定します。

root@www:~# vncpasswd
Password:
Verify:
Would you like to enter a view-only password (y/n)? n

VNC サーバー設定ファイルを作成します。

root@www:~# vi ~/.vnc/config
session=gnome
securitytypes=vncauth,tlsvnc
geometry=800x600

root権限でVNC サーバーを利用できるようにします。

root@www:~# vi /etc/tigervnc/vncserver.users
# TigerVNC User assignment
#
# This file assigns users to specific VNC display numbers.
# The syntax is <display>=<username>. E.g.:
#
# :2=andrew
# :3=lisa
:1=root
:2=webmaster

VNC サーバーを起動します。

root@www:~# systemctl enable --now vncserver@:1 vncserver@:2

再起動します。

root@www:~# reboot

クライアントPCにUltraVNCUltraVNC_1_2_40_X64_Setup.exeをダウンロードします。(ページの下部にダウンロードリンクがあります。)

UltraVNCをダウンロード

23bit、64bitを選択して「DOWNLOAD」をクリックします。

23bit、64bitを選択して「DOWNLOAD」

「I accept the above listed conditions」を選択して「Download」をクリックします。

「I accept the above listed conditions」を選択して「Download」

ダウンロードした「UltraVNC_***_Setup.exe」のアイコンをWクリックしてインストールします。

UltraVNC_***_Setup.exe

「Windowsスタートメニュー」をクリックし、「UltraVNC Viewer」を起動します。

Windowsスタートメニュー

先に起動したVNCサーバーのIPアドレス:ディスプレイ番号を入力をして「Connect」をクリックします。

VNCサーバーのIPアドレス:ディスプレイ番号を入力

VNCパスワードを入力し「Log on」をクリックします。

VNCパスワードを入力

ディスクトップが表示されます。

Xrdpサーバーの設定

Windows のリモートデスクトップ機能で接続できるようにXrdpサーバーをインストールして設定します。

[root@www ~]# dnf -y install xrdp tigervnc-server

自動起動を設定します。

[root@www ~]# systemctl enable --now xrdp

Windows スタートメニューから「アクセサリ」→「リモートデスクトップ接続」 を選択して接続画面を起動します。

スタートメニュー

サーバーIPアドレスを入力し「接続」をクリックします。

サーバーIPアドレスを入力し「接続」をクリック

「usermame」(ユーザー名)、「password」(パスワード)を入力し「OK」をクリックします。

ディスクトップが表示されます。

日本語環境の設定

日本語環境のパッケージをインストールします。

[root@www ~]# dnf -y install ibus-kkc vlgothic-*

システムの文字セットを設定します。

[root@www ~]# localectl set-locale LANG=ja_JP.UTF-8
[root@www ~]# source /etc/locale.conf

設定を確認します。

[root@www ~]# echo $LANG
ja_JP.UTF-8

Fedora35:ファイルサーバー設定

sambaのインストール

sambaをインストールします。

[root@www ~]# dnf install samba samba-client samba-common -y

sambaの初期設定

sambaの設定ファイルをバックアップ。

[root@www ~]# mv /etc/samba/smb.conf /etc/samba/smb.conf.bk

sambaを設定します。

[root@www ~]# vi /etc/samba/smb.conf

ファイルを作成します。

[global]
workgroup = WORKGROUP
server string = Samba Server %v
netbios name = fedora
security = user
map to guest = bad user
dns proxy = no
ntlm auth = yes
#==========================================================
[Share]
#共有フォルダ
path = /samba/share/
#マイネットワークに表示の有無
browsable = yes
#書き込み許可
writable = yes
#ゲストユーザのログイン許可
guest ok = yes
#読込みの許可
read only = no
#ファイル属性
force create mode = 0777
#ディレクトリ属性
force directory mode = 0777

共有フォルダを作成します。

root@www:~# mkdir /samba
root@www:~# mkdir /samba/share
root@www:~# chown nobody:nobody /samba/share
root@www:~# chmod 0777 /samba/share

自動起動します。

[root@www ~]# systemctl enable --now smb.service
[root@www ~]# systemctl enable --now nmb.service

再起動します。

[root@www ~]# reboot

クライアントWindowsPCを再起動し、「ネットワーク」→「linux」→「Share」を開いて書き込みができることを確認します。(「ネットワーク」→「linux」が表示されない場合はディスクトップの任意の場所で右クリックで新規フォルダを作成して、その新規フォルダを右クリックしてショートカットを作成し、そのショートカットを右クリックしてプロパティを開いてリンク先を「\\linux」に変更し接続します。)

WindowsPC

Fedora35:初期設定

rootファイルシステムを拡張

最上層部( / )rootファイルシステムを確認します。

[root@www ~]# df -h

ファイルシス             サイズ    使用  残り 使用% マウント位置
devtmpfs                   3.9G      0  3.9G     0% /dev
tmpfs                      3.9G      0  3.9G     0% /dev/shm
tmpfs                      3.9G   1.1M  3.9G     1% /run
/dev/fedora/fedora-root     15G   1.9G   14G    13% / #拡張
tmpfs                      3.9G   4.0K  3.9G     1% /tmp
/dev/sda1                  1014M  194M  821M    20% /boot
tmpfs                      783M      0  783M     0% /run/user/1000

rootファイルシステムはディフォルトで15Gb ですので拡張します。
記録した最上層部( / )のroot理論ボリュームを拡張します。(上記フォームにてご自身のファイルパスに変更してください。)

[webmaster@www ~]$ sudo lvextend -l +100%FREE /dev/fedora/fedora-root

記録した最上層部( / )のrootファイルシステムを拡張します。

[webmaster@www ~]$ sudo xfs_growfs /dev/fedora/fedora-root

一般ユーザーの作成

rootユーザーにログインします。

[webmaster@www ~]$ su -
パスワード:
[root@www ~]#

一般ユーザーを作成します。(初期設定では一般ユーザーは必要ありません。)

[root@www ~]# useradd ユーザー名

パスワードを設定します。

[root@www ~]# passwd ユーザー名
新しいパスワード:
新しいパスワードを再入力してください:

rootになれるユーザーを限定

rootになれるユーザーを限定します。

[root@www ~]# usermod -G wheel webmaster
[root@www ~]# vi /etc/pam.d/su

#を削除してコメント解除

#%PAM-1.0
auth            sufficient      pam_rootok.so
# Uncomment the following line to implicitly trust users in the "wheel" group.
#auth           sufficient      pam_wheel.so trust use_uid
# Uncomment the following line to require a user to be in the "wheel" group.
auth            required        pam_wheel.so use_uid
auth            substack        system-auth
auth            include         postlogin
account         sufficient      pam_succeed_if.so uid = 0 use_uid quiet
account         include         system-auth
password        include         system-auth
session         include         system-auth
session         include         postlogin
session         optional        pam_xauth.so

一般ユーザーの削除

ユーザーのみ削除する場合

[root@www ~]# userdel ユーザー名

ホームディレクトリも削除する場合

[root@www ~]# userdel -r ユーザー名

ファイアウォールとSELinuxを無効化

ファイアウォールサービス停止します。

[root@www ~]# systemctl stop firewalld

自動起動設定を無効にします。

[root@www ~]# systemctl disable firewalld
rm '/etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service'
rm '/etc/systemd/system/basic.target.wants/firewalld.service'

SELinux を無効にします。

[root@www ~]# vi /etc/selinux/config

disabled に変更します。

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled #変更
# SELINUXTYPE= can take one of these two values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted

再起動します。

[root@www ~]# reboot

ネットワークの設定

IPv6 を無効にします。

[root@www ~]# vi /etc/default/grub

6行目:「ipv6.disable=1」を追加します。

GRUB_CMDLINE_LINUX="ipv6.disable=1 rd.lvm.lv=linuxserver/root..

変更を反映します。

[root@www ~]# grub2-mkconfig -o /boot/grub2/grub.cfg
[root@www ~]# reboot

ルーター設定

ルーターでDHCP固定IPアドレス設定ができる場合は「MACアドレス」、「サーバーIPアドレス」を設定します。

DHCP固定IPアドレス設定

MACアドレス(例:0c:2e:48:2b:dg:f4)

サーバーIPアドレス:192.168.1.3

システムの最新化

システムを最新化します。

[root@www ~]# dnf -y update

モジュールを追加

Node.js をインストールします。

[root@www ~]# sudo yum -y install gcc-c++ make nodejs

モジュールを確認します。

[root@www ~]# node -v
v16.14.0

パッケージ自動更新設定

dnf-automaticをインストールします。

[root@www ~]# dnf install dnf-automatic dnf-utils -y

dnf-automaticを設定します。

[root@www ~]# vi /etc/dnf/automatic.conf

自動ダウンロード&自動アップデートを行うようにする

# Whether updates should be applied when they are available, by
# dnf-automatic.timer. notifyonly.timer, download.timer and
# install.timer override this setting.
apply_updates = yes #変更

パッケージ自動更新自動起動設定

[root@www ~]# systemctl enable --now dnf-automatic.timer

Web 管理コンソールの設定

Cockpit を有効にして Web 管理コンソールが利用可能にします。

[root@www ~]# systemctl enable --now cockpit.socket
[root@www ~]# ss -napt
State Recv-Q Send-Q Local Address:Port Peer Address:Port 
LISTEN 0 128 0.0.0.0:22 0.0.0.0:* users:(("sshd",pid=831,fd=6)) 
LISTEN 0 128 [::]:22 [::]:* users:(("sshd",pid=831,fd=8)) 
LISTEN 0 128 *:9090 *:* users:(("systemd",pid=1,fd=24)) 

クライアントPCのWebブラウザで、[http://192.168.1.3:9090/] へアクセスし「root」でログインします。

Vim(テキストエディタ)の設定

Vim(テキストエディタ)をインストールします。

[root@www ~]# dnf -y install vim-enhanced

コマンドエイリアスを適用します。

[root@www ~]# vi /etc/profile

最終行に追記します。

alias vi='vim'

変更を反映します。

[root@www ~]# source /etc/profile

vim の設定します。

[root@www ~]# vi ~/.vimrc

行番号を表示する(サーバー設定を行番号で説明いたします。)

set number

Sudo(root権限)のを設定

root権限を特定のユーザーに設定します。

[root@www ~]# visudo

最終行に追記します。

webmaster    ALL=(ALL)       ALL

Fedora35:SSHサーバー設定

SSHサーバーのインストール

サーバーにwebmasterでログインします。

localhost login: webmaster
password:

rootでログインします。

[webmaster@localhost ~]$ us -
password:

SSHサーバーをインストールします。

[root@localhost ~]# dnf install openssh-server openssh-clients

SSHサーバーを起動します。

[root@localhost ~]# systemctl start sshd

SSHサーバーを自動起動設定をします。

[root@localhost ~]# systemctl enable sshd

SSHサーバーの作動確認します。

[root@localhost ~]# systemctl status sshd
● sshd.service - OpenSSH server daemon
   Loaded: loaded (/usr/lib/systemd/system/sshd.service; enabled; vendor preset>
   Active: active (running) since Sun 2021-04-11 18:03:51 JST; 5h 16min ago
     Docs: man:sshd(8)
           man:sshd_config(5)
 Main PID: 870 (sshd)
    Tasks: 1 (limit: 23603)
   Memory: 4.6M
   CGroup: /system.slice/sshd.service
           mq870 /usr/sbin/sshd -D -oCiphers=aes256-gcm@openssh.com,chacha20-po>

 4月 11 18:03:51 localhost.localdomain systemd[1]: Starting OpenSSH server daem>
 4月 11 18:03:51 localhost.localdomain sshd[870]: Server listening on 0.0.0.0 p>
 4月 11 18:03:51 localhost.localdomain sshd[870]: Server listening on :: port 2>
 4月 11 18:03:51 localhost.localdomain systemd[1]: Started OpenSSH server daemo>
 4月 11 22:29:36 localhost.localdomain sshd[5425]: Accepted password for webmas>
 4月 11 22:29:36 localhost.localdomain sshd[5425]: pam_unix(sshd:session): sess>
 4月 11 23:19:30 localhost.localdomain sshd[5481]: Accepted password for webmas>
 4月 11 23:19:30 localhost.localdomain sshd[5481]: pam_unix(sshd:session): sess>
lines 1-19/19 (END)

「q」を押下して表示を終了します。

現在のネットワーク設定を確認

ネットワーク設定でIPアドレスを記録します。

webmaster@www:~$ ip addr
span style="color: #ffffff;">1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: enp14s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 0c:2e:48:2b:dg:f4 brd ff:ff:ff:ff:ff:ff
inet 192.168.1.3/24 brd 192.168.1.255 scope global dynamic enp2s0 #IPアドレス、インターファイス名記録
valid_lft 11984sec preferred_lft 11984sec
inet6 20sd:ahq23:46dg:7rh9:2dg5:28uf:fls4:dehd/64 scope global dynamic mngtmpaddr noprefixroute
valid_lft 13592sec preferred_lft 11792sec
inet6 fft0::21fg3:2j8f:fo60:djed/64 scope link
valid_lft forever preferred_lft forever

192.168.1.3」(記録したIPアドレス)でクライアントPCよりTera Termで接続します。