![]() |
| ◆ | CentOS8 or CentOS Stream 8 |
|
2020年12月09日に、CentOS8が2021年末でサポートを終了するという発表がありました。CentOSプロジェクトはCentOS
Streamへの移行を勧めていますのでCentOS Stream 8をインストールします。 しかし、インストール用ISOは9Gb以上もあり2層のDVDにも入り切れません。 また、CentOS Stream 8にはCentOS 8にあった最小インストール版(minimal)が無いためネットワークからやUSBからのインストールしかできません。 そこで私はCentOS 8 minimalをインストールしてからCentOS Stream 8に移行することにしました。 |
|
| ◆ | CentOS 8 minimalのインストール |
| インストールについては色々なサイトで解説&説明されているのでここでは省略します・・・・って、おいおい(笑) | |
| 最小版なのであっという間に終わってしまいました。 | |
| ◆ | CentOS8 ネットワークの設定 (IPアドレス) |
| CentOS8では、Network Managerによるネットワーク管理が推奨されていますので Network Manegerによる設定を行います。 | |
| ◆ | nmcli ( Networkmanager Command Line Interface )による設定 |
| 認識されているデバイスの確認 | |
|
[root@centos]# nmcli device DEVICE TYPE STATE CONNECTION enp2s0 ethernet disconnected -- lo loopback unmanaged -- |
|
| 認識されているデバイス名:enp2s0 | |
| ◆ | IPアドレス(192.168.1.***)設定 |
|
[root@centos]# nmcli connection modify enp2s0 ipv4.address 192.168.1.***/24 |
|
| ◆ | デフォルトゲートウェイ(192.168.1.*)設定 |
|
[root@centos]# nmcli connection modify enp2s0 ipv4.gateway 192.168.1.* |
|
| ◆ | Dns(192.168.1.*)設定 |
|
[root@centos]# nmcli connection modify enp2s0 ipv4.dns 192.168.1.* |
|
| ◆ | 上記 nmcli device で複数のデバイスを認識している場合の固定設定(enp2s0)設定 |
|
[root@centos]# nmcli connection modify enp2s0 ipv4.method manual |
|
| ◆ | 設定したデバイスを起動 |
|
[root@centos]# nmcli connection up enp2s0 Connection successfully activated(D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/〜) |
|
| ◆ | デバイスの起動確認 |
|
[root@centos]# nmcli device DEVICE TYPE STATE CONNECTION enp2s0 ethernet disconnected enp2s0 <--- デバイス名が表示されれが起動している lo loopback unmanaged -- |
|
| ◆ |
デバイスの停止(参考) |
|
[root@centos]# nmcli connection down enp2s0 Connection’enp2s0’successfully deactivated(D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/〜) |
|
| ◆ | デバイスの自動起動設定の確認 |
|
[root@centos]# nmcli connection show enp2s0 | grep connection.autoconnect connection.autoconnect: No <--- 設定されていない connection.autoconnect-priority: 0 connection.autoconnect-retries: -1 (default) connection.autoconnect-slaves: -1 (default) |
|
| ◆ | デバイスの自動起動設定 |
|
[root@centos]# nmcli connection modify enp2s0 connection.autoconnect yes |
|
| ◆ | 再度デバイスの自動起動設定の確認 |
|
[root@centos]# nmcli connection show enp2s0 | grep connection.autoconnect connection.autoconnect: Yes <--- 設定されている connection.autoconnect-priority: 0 connection.autoconnect-retries: -1 (default) connection.autoconnect-slaves: -1 (default) |
|
| ◆ | デバイスの設定確認 |
|
[root@centos]# nmcli device show enp2s0 GENERAL.DEVICE: enp2s0 GENERAL.TYPE: ethernet GENERAL.HWADDR: 50:E5:49:4C:A1:60 GENERAL.MTU: 1500 GENERAL.STATE: 100 (connected) GENERAL.CONNECTION: enp2s0 GENERAL.CON-PATH: /org/freedesktop/NetworkManager/ActiveConnection/4 WIRED-PROPERTIES.CARRIER: on IP4.ADDRESS[1]: 192.168.1.***/24 IP4.GATEWAY: 192.168.1.1 IP4.ROUTE[1]: dst = 192.168.1.*/24, nh = 0.0.0.0, mt =100 IP4.ROUTE[2]: dst = 0.0.0.0/0, nh = 192.168.1.*, mt =100 IP4.DNS[1]: 192.168.1.* IP6.ADDRESS[1]: 240d:2:831e:ec00:7b97:bb80:e835:c4ba/64 以下略 ↓ |
|
| ◆ | SSHサーバ |
| クライアント機よりSSHを使い作業した方が何かと便利なのでSSHの確認を行います。 基本的にはSSHサーバーはインストールされているはずですが念のため確認します。 |
|
| ◆ | インストール確認 |
|
[root@centos]# dnf list installed | grep ssh libssh.x86_64 0.9.4-2.el8 @anaconda ibssh-config.noarch 0.9.4-2.el8 @anaconda openssh.x86_64 8.0p1-5.el8 @anaconda openssh-clients.x86_64 8.0p1-5.el8 @anaconda openssh-server.x86_64 8.0p1-5.el8 @anaconda |
|
|
インストールされています。もし、インストールされていなければインストールします。 |
|
| ◆ | SSHサーバーのインストール |
|
[root@centos]# dnf install -y openssh [root@centos]# dnf install –y libssh |
|
| ◆ | SSHサーバーの起動 |
|
[root@centos]# systemctl start sshd |
|
| ◆ | sshサーバのシステム起動時の有効化 |
|
[root@centos]# systemctl enable sshd |
|
| ◆ | sshサーバの起動状態を確認 |
|
[root@centos]# systemctl status shy ● sshd.service - OpenSSH server daemonv Loaded: loaded (/usr/lib/systemd/system/sshd.service; enabled; vendor preset: enabled) Active: active (running) since Fri 2021-04-09 20:04:33 EDT; 3h 29min ago Docs: man:sshd(8) man:sshd_config(5) Main PID: 833 (sshd) Tasks: 1 (limit: 10423) Memory: 5.2M CGroup: /system.slice/sshd.service └─833 /usr/sbin/sshd -D -oCiphers=aes256-gcm@openssh.com, 以下略 |
|
|
緑色の丸や上記のような情報が表示されていたら正常稼働しています。 |
|
| ※続きはインストール&ネットワーク設定 その2 | |