LoginSignup
6
1

More than 3 years have passed since last update.

Cent OS 8 触ってみた。

Last updated at Posted at 2019-09-25

待ちに待った(?)CentOS 8がリリースされましたので、当方が初期設定として行う部分をとりあえず触ってみました。CentOS 7の時と違うところあるかな。という検証記事です。なぜ動かなかった等深く掘り下げる予定も現状ありません。

ゆえに記事にするには"あまりにも"レベルが低すぎますが、まだ日本語の記事がほとんどないのでとりあえず残しておきます。

VMware上にminimal Installで進めます。

Download

執筆時点(2019/09/24)ではCent OSの公式ページで8.0を確認できないので
IIJのリンクを貼っておきます。
http://ftp.iij.ad.jp/pub/linux/centos/8.0.1905/isos/x86_64/
この中のCentOS-8-x86_64-1905-dvd1.isoをダウンロードすればよいと思います。

※2019/09/25 16:55 追記
すでにCent OSの公式ページにてCentOS 8.0が配信されていました。
https://www.centos.org/

Install

USBメモリに焼くなり、VMware等で起動するなりご自由にどうぞ。
インストール画面のGUIは7の時と比べて大差ありませんでした。
向き(?)が変わったくらいです。(語彙力)

起動

[root@localhost ~]# cat /etc/redhat-release 
CentOS Linux release 8.0.1905 (Core)

[root@localhost ~]# uname -a
Linux localhost.localdomain 4.18.0-80.el8.x86_64 #1 SMP Tue Jun 4 09:19:46 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

きちんとCent OS 8.0です。

Firewall

ポート開放を行ってみました。特にCent OS 7と変わっていません。

[root@localhost ~]# systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemon
   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)
   Active: active (running) since Wed 2019-09-25 13:48:46 JST; 1h 2min ago
     Docs: man:firewalld(1)
 Main PID: 761 (firewalld)
    Tasks: 2 (limit: 24025)
   Memory: 35.1M
   CGroup: /system.slice/firewalld.service
           └─761 /usr/libexec/platform-python -s /usr/sbin/firewalld --nofork --nopid

Sep 25 13:48:45 localhost.localdomain systemd[1]: Starting firewalld - dynamic firewall daemon...
Sep 25 13:48:46 localhost.localdomain systemd[1]: Started firewalld - dynamic firewall daemon.
[root@localhost ~]# 
[root@localhost ~]# 
[root@localhost ~]# 
[root@localhost ~]# systemctl stop firewalld
[root@localhost ~]# systemctl start firewalld
[root@localhost ~]# 
[root@localhost ~]# 
[root@localhost ~]# firewall-cmd --add-service=https --zone=public --permanent
success
[root@localhost ~]# firewall-cmd --add-port=8080/tcp --zone=public --permanent
success
[root@localhost ~]# firewall-cmd --reload
success
[root@localhost ~]# firewall-cmd --list-all
public (active)
  target: default
  icmp-block-inversion: no
  interfaces: ens192
  sources: 
  services: cockpit dhcpv6-client https ssh
  ports: 8080/tcp
  protocols: 
  masquerade: no
  forward-ports: 
  source-ports: 
  icmp-blocks: 
  rich rules: 

[root@localhost ~]#

SELinux

いつも無効にしてしまうので無効化だけ行いました。これも変化なし。

[root@localhost ~]# getenforce
Enforcing
[root@localhost ~]# setenforce 0
[root@localhost ~]# getenforce
Permissive
[root@localhost ~]# 
[root@localhost ~]# 
[root@localhost ~]# 
[root@localhost ~]# setenforce 1
[root@localhost ~]# getenforce
Enforcing
[root@localhost ~]# sed -i 's/SELINUX=enforcing/#SELINUX=enforcing/g' /etc/selinux/config
[root@localhost ~]# sed -i 'N;/#SELINUX=enforcing/i\SELINUX=disabled' /etc/selinux/config
[root@localhost ~]#
[root@localhost ~]# sestatus
SELinux status:                 enabled
SELinuxfs mount:                /sys/fs/selinux
SELinux root directory:         /etc/selinux
Loaded policy name:             targeted
Current mode:                   enforcing
Mode from config file:          disabled
Policy MLS status:              enabled
Policy deny_unknown status:     allowed
Memory protection checking:     actual (secure)
Max kernel policy version:      31
[root@localhost ~]#

Network Manager

検証中ですが、Network Managerをただただ無効にするだけだと再起動後にSSH接続ができなくなりました。
まず/etc/sysconfig/network-scripts/ifcfg-ens192にIPアドレス等を設定し、
次にNetwork Managerを止めて、自動起動を無効化します。その後再起動します。

①ifcfg-ens192編集

[root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-ens192 
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=static
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=ens192
UUID=f1e71063-064d-41cc-985e-6b8435f7a754
DEVICE=ens192
ONBOOT=yes

IPADDR=192.168.1.140
PREFIX=24
GATEWAY=192.168.1.1

DNS1=8.8.8.8
[root@localhost ~]#

②NetworkManagerの停止と無効化、再起動

[root@localhost ~]# systemctl stop NetworkManager
[root@localhost ~]# systemctl disable NetworkManager
Removed /etc/systemd/system/multi-user.target.wants/NetworkManager.service.
Removed /etc/systemd/system/dbus-org.freedesktop.NetworkManager.service.
Removed /etc/systemd/system/dbus-org.freedesktop.nm-dispatcher.service.
Removed /etc/systemd/system/network-online.target.wants/NetworkManager-wait-online.service.
[root@localhost ~]# 
[root@localhost ~]# 
[root@localhost ~]# 
[root@localhost ~]# 
[root@localhost ~]# ip a
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: ens192: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 00:0c:29:13:29:f1 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.140/24 brd 192.168.1.255 scope global dynamic noprefixroute ens192
       valid_lft 86398sec preferred_lft 86398sec
    inet6 fe80::8f3d:698b:1c:14a1/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever
[root@localhost ~]#
[root@localhost ~]# sync
[root@localhost ~]# sync
[root@localhost ~]# init 6

再起動すると

localhost.localdomain_ VMware ESXi - Google Chrome 2019_09_25 16_09_15 (2).png

現状はNetworkManagerを起動して再起動で。

systemctl start NetworkManager
systemctl enable NetworkManager
sync
init 6

再起動したら無事SSHできました。

[root@localhost ~]# ip a
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: ens192: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 00:0c:29:13:29:f1 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.140/24 brd 192.168.1.255 scope global dynamic noprefixroute ens192
       valid_lft 86273sec preferred_lft 86273sec
    inet6 fe80::8f3d:698b:1c:14a1/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever
[root@localhost ~]

[root@localhost ~]# ping google.com
PING google.com (172.217.25.110) 56(84) bytes of data.
64 bytes from nrt13s51-in-f110.1e100.net (172.217.25.110): icmp_seq=1 ttl=50 time=2.99 ms
64 bytes from nrt13s51-in-f110.1e100.net (172.217.25.110): icmp_seq=2 ttl=50 time=2.12 ms
64 bytes from nrt13s51-in-f110.1e100.net (172.217.25.110): icmp_seq=3 ttl=50 time=1.77 ms
64 bytes from nrt13s51-in-f110.1e100.net (172.217.25.110): icmp_seq=4 ttl=50 time=2.55 ms
^C
--- google.com ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 8ms
rtt min/avg/max/mdev = 1.773/2.357/2.989/0.461 ms

ipコマンドでLink upはできるのですが、それだけだとやはり期待するような通信はできませんでした。

DNS 追加

順序逆になってしまいましたがファイル名や場所に変更はありませんでした。
GoogleのDNSを追加するだけ行いました。
問題なし。
上記のNetworkManager問題が解決すればですが。

cat > /etc/resolv.conf <<EOF
options timeout:1 attempts:1
nameserver 8.8.8.8
EOF

limits.conf 編集

ファイルの同時アクセスとプロセス上限を上げるもの(らしい)
こちらもファイルやパスに変更はない模様。

sed -i 's/# End of file//g' /etc/security/limits.conf
cat >> /etc/security/limits.conf << EOF
*        soft   nproc  65535
*        hard   nproc  65535
*        soft   nofile  65535
*        hard   nofile  65535

# End of file
EOF

で、Cent OS 7の場合は

sed -i 's/4096/65535/g' /etc/security/limits.d/20-nproc.conf
sed: can't read /etc/security/limits.d/20-nproc.conf: No such file or directory

こちらのファイルも変更すべきなのだそうですが、こちらのファイルはありませんでした。
このディレクトリを調べると

[root@localhost ~]# cd /etc/security/limits.d/
[root@localhost limits.d]# ll
total 0
[root@localhost limits.d]#

中身なし。

yum install

これも特段変更はない模様

[root@localhost security]# yum install -y vim
Last metadata expiration check: 0:15:56 ago on Wed 25 Sep 2019 04:24:24 PM JST.
Dependencies resolved.
===========================================================================================================================================================
 Package                                Arch                           Version                                     Repository                         Size
===========================================================================================================================================================
Installing:
 vim-enhanced                           x86_64                         2:8.0.1763-10.el8                           AppStream                         1.4 M
Installing dependencies:
 gpm-libs                               x86_64                         1.20.7-15.el8                               AppStream                          39 k
 vim-common                             x86_64                         2:8.0.1763-10.el8                           AppStream                         6.3 M
 vim-filesystem                         noarch                         2:8.0.1763-10.el8                           AppStream                          48 k

Transaction Summary
===========================================================================================================================================================
Install  4 Packages

Total download size: 7.8 M
Installed size: 30 M
Downloading Packages:
(1/4): gpm-libs-1.20.7-15.el8.x86_64.rpm                                                                                    37 kB/s |  39 kB     00:01    
(2/4): vim-filesystem-8.0.1763-10.el8.noarch.rpm                                                                           1.5 MB/s |  48 kB     00:00    
(3/4): vim-enhanced-8.0.1763-10.el8.x86_64.rpm                                                                             1.0 MB/s | 1.4 MB     00:01    
(4/4): vim-common-8.0.1763-10.el8.x86_64.rpm                                                                               3.6 MB/s | 6.3 MB     00:01    
-----------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                      2.5 MB/s | 7.8 MB     00:03     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                   1/1 
  Installing       : vim-filesystem-2:8.0.1763-10.el8.noarch                                                                                           1/4 
  Installing       : vim-common-2:8.0.1763-10.el8.x86_64                                                                                               2/4 
  Installing       : gpm-libs-1.20.7-15.el8.x86_64                                                                                                     3/4 
  Running scriptlet: gpm-libs-1.20.7-15.el8.x86_64                                                                                                     3/4 
  Installing       : vim-enhanced-2:8.0.1763-10.el8.x86_64                                                                                             4/4 
  Running scriptlet: vim-enhanced-2:8.0.1763-10.el8.x86_64                                                                                             4/4 
  Running scriptlet: vim-common-2:8.0.1763-10.el8.x86_64                                                                                               4/4 
  Verifying        : gpm-libs-1.20.7-15.el8.x86_64                                                                                                     1/4 
  Verifying        : vim-common-2:8.0.1763-10.el8.x86_64                                                                                               2/4 
  Verifying        : vim-enhanced-2:8.0.1763-10.el8.x86_64                                                                                             3/4 
  Verifying        : vim-filesystem-2:8.0.1763-10.el8.noarch                                                                                           4/4 

Installed:
  vim-enhanced-2:8.0.1763-10.el8.x86_64   gpm-libs-1.20.7-15.el8.x86_64   vim-common-2:8.0.1763-10.el8.x86_64   vim-filesystem-2:8.0.1763-10.el8.noarch  

Complete!
[root@localhost security]#

おわりに

とりあえず当方の使い方ではCentOS 7と比較してNetworkまわりで苦戦しそうというところまではわかりました。
この記事の範囲外でも変更点・回避方法等あればコメント・指摘をお願いいたします。

参考文献

CentOS-8 (1905)リリースノート
https://wiki.centos.org/ja/Manuals/ReleaseNotes/CentOS8.1905

6
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
1