- 投稿日:2020-11-16T23:15:33+09:00
Linux非対応なtp-linkの無線LAN子機を使う方法
tp-linkの無線LAN子機(以降無線LANと呼びます)を購入したのですが、Linuxに対応していないようなので、有志の方が作成したドライバをインストールする方法を紹介します。
1.GitHubで公開されてるドライバをダウンロードする
RTL8812AU/21AU Wireless drivers
このドライバをダウンロードするので、はじめにターミナルからGitとdkmsをインストールします。
はじめに、Gitをインストール
sudo apt install git-all
その次にdkmsをインストール
sudo apt install dkms
これでドライバをダウンロードする準備が整いました。
Githubからドライバをダウンロードします。
git clone https://github.com/aircrack-ng/rtl8812au.git
これを実行するとダウンロードが始まるのでしばらく待ってください。
ダウンロードが終わったらrtl8812au
というディレクトリが作成され、そこにダウンロードされているのでそのまま
cd rtl8812au
を実行します。
そして移動したディレクトリでdkms_installを実行するとインストールが完了します。
sudo make dkms_install
認識されない場合は刺し直したり再起動したら認識されると思います。
ではまた。
- 投稿日:2020-11-16T18:08:13+09:00
サイバー脅威情報集約システム(EXIST)とMISPの構築まとめ①
はじめに
- 元同僚から面白そうなOSSを教えてもらったので調べがてら構築をしてみた.
- ここでは構築する際にトラブった箇所や手順などをまとめていく感じです.
- ALL-in-One方式で構築した際、取得したデータサイズのせいかDiskFull-->LVM追加でミスって-->VMクラッシュという楽しい目にあったため個別での構築としています.
- 3部構成(共通部分/EXIST/MISP)で記事を書く予定です.
前提
- Windows10pro Hyper-Vを利用し以下条件のもと構築を行っております.(共通)
- お好みでVMwareやvBOXをお使いください
- OSはCentOS7の最新版を利用しそれぞれ別VMで構築とする.(共通)
- 検証環境下ではCentOS8自体の挙動が不安定だったので別途原因究明が必要と考えCentOS7を選択
- 構築時のアカウントはすべてrootアカウントで実施.(共通)
- VMのリソースはvCPU:2core,mem:8GB,DISK:50GB,Network:IPアドレスはDHCPでMACアドレス登録して固定配布.(共通)
- 稼働するとメモリ使用量は平均6GB
- DISKは20GBで100%超えてしまったため、50GBにしております
- pyenvを使用しPython ver3.6.xをインストール.(EXIST)
- Verison3.7以降だと指定PackageのVersionではエラーが発生するため
- venv-existを使わずに構築していきます
- git:Verは2.29.x(現時点で最新のもの)とする.(共通)
- 2.x台であればなんでもよいかと
- wget/curl/tmux/htopなど適宜インストール.
- 不要な人はスルーでもOK
- FirewallやSElinuxは自己責任のもと無効にしてください.(共通)
- Firewallではのちに8000ポートの開放を手順に入れております
- SElinuxは土下座してdisabledにしております
OSS製品のドキュメント
サイバー脅威情報集約システム(EXIST)
Malware Information Sharing Platform(MISP)共通部分の構築
- OSの状態は「最小限」を選択肢しインストール済み.
kernel-ml関連のインストールと読み込み順序の変更
# cat /etc/redhat-release CentOS Linux release 7.9.2009 (Core) # # uname -a Linux [hostname] 3.10.0 ~省略~ # # rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org # # yum install https://www.elrepo.org/elrepo-release-7.el7.elrepo.noarch.rpm 読み込んだプラグイン:fastestmirror | | 省略 | | 警告: RPMDB は yum 以外で変更されました。 インストール中 : elrepo-release-7.0-5.el7.elrepo.noarch 1/1 検証中 : elrepo-release-7.0-5.el7.elrepo.noarch 1/1 インストール: elrepo-release.noarch 0:7.0-5.el7.elrepo 完了しました! # # yum --enablerepo=elrepo-kernel install kernel-ml Loaded plugins: fastestmirror, langpacks | | 省略 | | Dependencies Resolved ======================================================================================================================== Package Arch Version Repository Size ========================================================================================================================Installing: kernel-ml x86_64 5.9.8-1.el7.elrepo elrepo-kernel 51 M Transaction Summary ========================================================================================================================Install 1 Package Total download size: 51 M Installed size: 233 M Is this ok [y/d/N]: y Downloading packages: kernel-ml-5.9.8-1.el7.elrepo.x86_64.rpm | 51 MB 00:00:09 Running transaction check Running transaction test Transaction test succeeded Running transaction Installing : kernel-ml-5.9.8-1.el7.elrepo.x86_64 1/1 Verifying : kernel-ml-5.9.8-1.el7.elrepo.x86_64 1/1 Installed: kernel-ml.x86_64 0:5.9.8-1.el7.elrepo Complete!新旧Kernelが混在中なので新しいものに置き換え
# # rpm -qa |grep kernel kernel-ml-5.9.8-1.el7.elrepo.x86_64 kernel-3.10.0-1127.19.1.el7.x86_64 kernel-headers-3.10.0~ kernel-devel-3.10.0~ kernel-tools-libs-3.10.0~ # # yum swap --enablerepo=elrepo-kernel kernel-* -- kernel-ml-* <--リポジトリをenableにしていないためオプションで指定 Loaded plugins: fastestmirror, langpacks Skipping the running kernel: kernel-3.10.0-1127.19.1.el7.x86_64 Loading mirror speeds from cached hostfile | | 省略 | | Is this ok [y/d/N]: y Downloading packages: Delta RPMs disabled because /usr/bin/applydeltarpm not installed. (1/7): kernel-ml-devel-5.9.8-1.el7.elrepo.x86_64.rpm | 13 MB 00:00:04 (2/7): kernel-ml-doc-5.9.8-1.el7.elrepo.noarch.rpm | 8.9 MB 00:00:01 (3/7): kernel-ml-headers-5.9.8-1.el7.elrepo.x86_64.rpm | 1.4 MB 00:00:00 (4/7): kernel-ml-tools-5.9.8-1.el7.elrepo.x86_64.rpm | 229 kB 00:00:00 (5/7): kernel-ml-tools-libs-5.9.8-1.el7.elrepo.x86_64.rpm | 117 kB 00:00:00 (6/7): kernel-ml-tools-libs-devel-5.9.8-1.el7.elrepo.x86_64.rpm | 95 kB 00:00:00 (7/7): kernel-ml-5.9.8-1.el7.elrepo.x86_64.rpm | 51 MB 00:00:09 --------------------------------------------------------------------------------------------------------------------- Total 7.6 MB/s | 76 MB 00:00:09 | | 省略 | | Complete! # # rpm -qa |grep kernel kernel-ml-tools-5.9.8-1.el7.elrepo.x86_64 kernel-ml-devel-5.9.8-1.el7.elrepo.x86_64 kernel-ml-tools-libs-devel-5.9.8-1.el7.elrepo.x86_64 kernel-3.10.0-1127.19.1.el7.x86_64 kernel-ml-5.9.8-1.el7.elrepo.x86_64 kernel-ml-tools-libs-5.9.8-1.el7.elrepo.x86_64 kernel-ml-doc-5.9.8-1.el7.elrepo.noarch kernel-ml-headers-5.9.8-1.el7.elrepo.x86_64 古いカーネルを削除 # # yum remove kernel-3.10.0OS起動時のKernel読み込み順を変更<--古いカーネルを削除していれば基本スルーでOK
# # awk -F\' '$1=="menuentry " {print i++ " : " $2}' /etc/grub2.cfg 0 : CentOS Linux (3.10.0-1127.19.1.el7.x86_64) 7 (Core) 1 : CentOS Linux (5.9.8-1.el7.elrepo.x86_64) 7 (Core) <--こいつを選択 2 : CentOS Linux 7 Rescue 58dbc0c56878451db0f22c3af5129299 (3.10.0-693.17.1.el7.x86_64) 3 : CentOS Linux (0-rescue-55a201f65e044fb291c90c84936d9385) 7 (Core) 4 : CentOS Linux (0-rescue-e139e4d1f5ec417fb1ae634270a99f8b) 7 (Core # # grub2-editenv list saved_entry=0 # # grub2-set-default 1 # # grub2-editenv list saved_entry=1 反映確認のため再起動 # # reboot各パッケージのアップデート&個別で必要なパッケージのインストール
古いカーネルの再インストールを防ぐため除外設定を行う. # # echo "exclude=kernel*" >> /etc/yum.conf # # yum update --enablerepo=elrepo-kernel | | 省略 | | Complete! # # yum install tmux htop wget curl | | 省略 | | Complete!Gitのアップデート
Gitは以下にある参考サイトなどでインストールしてみてくださいませ.
以上
共通部はここまでとなります.
次はEXISTの構築となります.参考サイト/多謝
Kernel関連
elrepo.org
kernel-ml
CentOS7でelrepoリポジトリを有効化してkernel-mlを入れる
CentOS 7でデフォルトのカーネルを変更・指定する
YUMチートシート
- 投稿日:2020-11-16T18:08:13+09:00
サイバー脅威情報集約システム(EXIST)とMalware Information Sharing Platform(MISP)の構築まとめ①
はじめに
- 元同僚から面白そうなOSSを教えてもらったので調べがてら構築をしてみた.
- ここでは構築する際にトラブった箇所や手順などをまとめていく感じです.
- ALL-in-One方式で構築した際、取得したデータサイズのせいかDiskFull-->LVM追加でミスって-->VMクラッシュという楽しい目にあったため個別での構築としています.
- 3部構成(共通部分/EXIST/MISP)で記事を書く予定です.
前提
- Windows10pro Hyper-Vを利用し以下条件のもと構築を行っております.(共通)
- お好みでVMwareやvBOXをお使いください
- OSはCentOS7の最新版を利用しそれぞれ別VMで構築とする.(共通)
- 検証環境下ではCentOS8自体の挙動が不安定だったので別途原因究明が必要と考えCentOS7を選択
- 構築時のアカウントはすべてrootアカウントで実施.(共通)
- VMのリソースはvCPU:2core,mem:8GB,DISK:50GB,Network:IPアドレスはDHCPでMACアドレス登録して固定配布.(共通)
- 稼働するとメモリ使用量は平均6GB
- DISKは20GBで100%超えてしまったため、50GBにしております
- pyenvを使用しPython ver3.6.xをインストール.(EXIST)
- Verison3.7以降だと指定PackageのVersionではエラーが発生するため
- venv-existを使わずに構築していきます
- git:Verは2.29.x(現時点で最新のもの)とする.(共通)
- 2.x台であればなんでもよいかと
- wget/curl/tmux/htopなど適宜インストール.
- 不要な人はスルーでもOK
- FirewallやSElinuxは自己責任のもと無効にしてください.(共通)
- Firewallではのちに8000ポートの開放を手順に入れております
- SElinuxは土下座してdisabledにしております
OSS製品のドキュメント
サイバー脅威情報集約システム(EXIST)
Malware Information Sharing Platform(MISP)共通部分の構築
- OSの状態は「最小限」を選択肢しインストール済み.
kernel-ml関連のインストールと読み込み順序の変更
# cat /etc/redhat-release CentOS Linux release 7.9.2009 (Core) # # uname -a Linux [hostname] 3.10.0 ~省略~ # # rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org # # yum install https://www.elrepo.org/elrepo-release-7.el7.elrepo.noarch.rpm 読み込んだプラグイン:fastestmirror | | 省略 | | 警告: RPMDB は yum 以外で変更されました。 インストール中 : elrepo-release-7.0-5.el7.elrepo.noarch 1/1 検証中 : elrepo-release-7.0-5.el7.elrepo.noarch 1/1 インストール: elrepo-release.noarch 0:7.0-5.el7.elrepo 完了しました! # # yum --enablerepo=elrepo-kernel install kernel-ml Loaded plugins: fastestmirror, langpacks | | 省略 | | Dependencies Resolved ======================================================================================================================== Package Arch Version Repository Size ========================================================================================================================Installing: kernel-ml x86_64 5.9.8-1.el7.elrepo elrepo-kernel 51 M Transaction Summary ========================================================================================================================Install 1 Package Total download size: 51 M Installed size: 233 M Is this ok [y/d/N]: y Downloading packages: kernel-ml-5.9.8-1.el7.elrepo.x86_64.rpm | 51 MB 00:00:09 Running transaction check Running transaction test Transaction test succeeded Running transaction Installing : kernel-ml-5.9.8-1.el7.elrepo.x86_64 1/1 Verifying : kernel-ml-5.9.8-1.el7.elrepo.x86_64 1/1 Installed: kernel-ml.x86_64 0:5.9.8-1.el7.elrepo Complete!新旧Kernelが混在中なので新しいものに置き換え
# # rpm -qa |grep kernel kernel-ml-5.9.8-1.el7.elrepo.x86_64 kernel-tools-3.10.0-1062.el7.x86_64 kernel-tools-libs-3.10.0-1062.el7.x86_64 kernel-3.10.0-1062.el7.x86_64 # # yum swap --enablerepo=elrepo-kernel kernel-* -- kernel-ml-* <--リポジトリをenableにしていないためオプションで指定 Loaded plugins: fastestmirror, langpacks Skipping the running kernel: kernel-3.10.0-1127.19.1.el7.x86_64 Loading mirror speeds from cached hostfile | | 省略 | | Is this ok [y/d/N]: y Downloading packages: Delta RPMs disabled because /usr/bin/applydeltarpm not installed. (1/7): kernel-ml-devel-5.9.8-1.el7.elrepo.x86_64.rpm | 13 MB 00:00:04 (2/7): kernel-ml-doc-5.9.8-1.el7.elrepo.noarch.rpm | 8.9 MB 00:00:01 (3/7): kernel-ml-headers-5.9.8-1.el7.elrepo.x86_64.rpm | 1.4 MB 00:00:00 (4/7): kernel-ml-tools-5.9.8-1.el7.elrepo.x86_64.rpm | 229 kB 00:00:00 (5/7): kernel-ml-tools-libs-5.9.8-1.el7.elrepo.x86_64.rpm | 117 kB 00:00:00 (6/7): kernel-ml-tools-libs-devel-5.9.8-1.el7.elrepo.x86_64.rpm | 95 kB 00:00:00 (7/7): kernel-ml-5.9.8-1.el7.elrepo.x86_64.rpm | 51 MB 00:00:09 --------------------------------------------------------------------------------------------------------------------- Total 7.6 MB/s | 76 MB 00:00:09 | | 省略 | | Complete! # # rpm -qa |grep kernel kernel-ml-tools-libs-5.9.8-1.el7.elrepo.x86_64 kernel-ml-doc-5.9.8-1.el7.elrepo.noarch kernel-ml-tools-libs-devel-5.9.8-1.el7.elrepo.x86_64 kernel-ml-5.9.8-1.el7.elrepo.x86_64 kernel-ml-tools-5.9.8-1.el7.elrepo.x86_64 kernel-ml-devel-5.9.8-1.el7.elrepo.x86_64 kernel-ml-headers-5.9.8-1.el7.elrepo.x86_64 kernel-3.10.0-1062.el7.x86_64 古いカーネルを削除 # # rpm -e kernel-3.10.0-1062.el7.x86_64OS起動時のKernel読み込み順を変更<--古いカーネルを削除していれば基本スルーでOK
# # awk -F\' '$1=="menuentry " {print i++ " : " $2}' /etc/grub2.cfg 0 : CentOS Linux (3.10.0-1127.19.1.el7.x86_64) 7 (Core) 1 : CentOS Linux (5.9.8-1.el7.elrepo.x86_64) 7 (Core) <--こいつを選択 2 : CentOS Linux 7 Rescue 58dbc0c56878451db0f22c3af5129299 (3.10.0-693.17.1.el7.x86_64) 3 : CentOS Linux (0-rescue-55a201f65e044fb291c90c84936d9385) 7 (Core) 4 : CentOS Linux (0-rescue-e139e4d1f5ec417fb1ae634270a99f8b) 7 (Core # # grub2-editenv list saved_entry=0 # # grub2-set-default 1 # # grub2-editenv list saved_entry=1 反映確認のため再起動 # # reboot各パッケージのアップデート&個別で必要なパッケージのインストール
古いカーネルの再インストールを防ぐため除外設定を行う. # # echo "exclude=kernel*" >> /etc/yum.conf # # yum update --enablerepo=elrepo-kernel | | 省略 | | Complete! # # yum install epel-release | | 省略 | | Complete! # # yum install vim tmux htop wget curl gcc autoconf curl-devel expat-devel gettext-devel openssl-devel perl-devel zlib-devel | | 省略 | | Complete!Gitのアップデート
- Gitは以下にある参考サイトなどでインストールしてみてくださいませ.
- インストールで必要になるパッケージは上記のyumで対応しております
以上
共通部はここまでとなります.
次はEXISTの構築となります.参考サイト/多謝
Kernel関連
elrepo.org
kernel-ml
CentOS7でelrepoリポジトリを有効化してkernel-mlを入れる
CentOS 7でデフォルトのカーネルを変更・指定する
YUMチートシート
- 投稿日:2020-11-16T00:37:14+09:00
OCI Compute上のLinux仮想マシンにMySQLをインストールしてみた
- Oracle MySQL Database Serviceの使い方メモ〜番外編
- Oracle Linux 8/7(CentOS7)とMySQL Community Server 8.0/5.7の組合わせで手こずったのでその忘備録
はじめに
Oracle Cloud Infrastructure (OCI) Compute ServiceでORACLE標準イメージとして提供されているOracle LinuxとCentOS上にMySQL Community Serverをインストールする手順をまとめました。Oracle Linux 8/7(CentOS7)とMySQL Community Server 8.0/5.7の組合わせで確認しています。
インストール・コマンドまとめ
詳細な手順の説明の前にそれぞれの組み合わせの際のインストール・コマンドをまとめました。リポジトリの確認等のコマンドは省略しています。
Oracle Linux 8.2
検証環境
Oracle Linux Server release 8.2
MySQL Ver 8.0.22
MySQL Ver 5.7.32MySQL 8.0のインストール
$ sudo rpm -Uvh http://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm $ sudo dnf module disable mysql mariadb $ sudo dnf install mysql-community-server $ sudo systemctl start mysqld $ sudo cat /var/log/mysqld.log | grep password $ mysql_secure_installationMySQL 5.7のインストール
$ sudo rpm -Uvh https://repo.mysql.com/yum/mysql-5.7-community/el/7/x86_64/mysql-community-release-el7-7.noarch.rpm $ sudo dnf config-manager --disable mysql56-community $ sudo dnf config-manager --enable mysql57-community $ sudo dnf module disable mysql mariadb $ sudo dnf install mysql-community-server $ sudo systemctl start mysqld $ sudo cat /var/log/mysqld.log | grep password $ mysql_secure_installationOracle Linux 7.9 / CentOS Linux 7.8
検証環境
Oracle Linux Server release 7.9
CentOS Linux release 7.8
MySQL Ver 8.0.22
MySQL Ver 5.7.32MySQL 8.0のインストール
$ sudo rpm -Uvh http://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm $ sudo yum install mysql-community-server $ sudo systemctl start mysqld $ sudo cat /var/log/mysqld.log | grep password $ mysql_secure_installationMySQL 5.7のインストール
$ sudo rpm -Uvh https://repo.mysql.com/yum/mysql-5.7-community/el/7/x86_64/mysql-community-release-el7-7.noarch.rpm $ sudo yum-config-manager --disable mysql56-community $ sudo yum-config-manager --enable mysql57-community $ sudo yum install mysql-community-server $ sudo systemctl start mysqld $ sudo cat /var/log/mysqld.log | grep password $ mysql_secure_installationインストール手順詳細
Oracle Linux 8.2上にMySQL 8.0をインストールした場合の実行ログをもとに詳細な手順を確認していきます。RHEL8.0で登場したdnf(yum) コマンドを使いました1。OCI Compute Serviceで作成した仮想マシンのORACLE提供イメージのOSバージョンから確認していきます。
$ cat /etc/oracle-release Oracle Linux Server release 8.2次に、Oracle Linux 8に対応したMySQL 8.0のRPMファイルをインストールします。Yumのリポジトリは下記にあります。
MySQL Community Downloads - MySQL Yum Repository$ sudo rpm -Uvh http://dev.mysql.com/get/mysql80-community-release-el8-1.noarch.rpm有効になっているリポジトリを確認します。
$ sudo dnf repolist all Failed to set locale, defaulting to C.UTF-8 repo id repo name status ksplice-uptrack Ksplice Uptrack for Oracle Linux disabled mysql-cluster-8.0-community MySQL Cluster 8.0 Community disabled mysql-cluster-8.0-community-source MySQL Cluster 8.0 Community - Source disabled mysql-connectors-community MySQL Connectors Community enabled mysql-connectors-community-source MySQL Connectors Community - Source disabled mysql-tools-community MySQL Tools Community enabled mysql-tools-community-source MySQL Tools Community - Source disabled mysql-tools-preview MySQL Tools Preview disabled mysql-tools-preview-source MySQL Tools Preview - Source disabled mysql80-community MySQL 8.0 Community Server enabled mysql80-community-source MySQL 8.0 Community Server - Source disabled ol8_UEKR6 Latest Unbreakable Enterprise Kernel Release enabled ol8_UEKR6_RDMA Oracle Linux 8 UEK6 RDMA (x86_64) disabled ol8_addons Oracle Linux 8 Addons (x86_64) enabled ol8_appstream Oracle Linux 8 Application Stream (x86_64) enabled ol8_baseos_latest Oracle Linux 8 BaseOS Latest (x86_64) enabled ol8_codeready_builder Oracle Linux 8 CodeReady Builder (x86_64) - U disabled ol8_developer Oracle Linux 8 Development Packages (x86_64) disabled ol8_developer_EPEL Oracle Linux 8 EPEL Packages for Development disabled ol8_developer_UEKR6 Developer Preview of UEK Release 6 (x86_64) disabled ol8_ksplice Ksplice for Oracle Linux 8 (x86_64) enabled ol8_oci Oracle Linux 8 OCI Packages (x86_64) enabled ol8_oci_included Oracle Software for OCI users on Oracle Linux enabled ol8_u0_baseos_base Oracle Linux 8 BaseOS GA (x86_64) disabled ol8_u1_baseos_base Oracle Linux 8.1 BaseOS (x86_64) disabled ol8_u2_baseos_base Oracle Linux 8.2 BaseOS (x86_64) disabledデフォルトで設定されているMySQLとMarinaDBのモジュールを無効化します。
$ sudo dnf module disable mysql mariadb下記のコマンドでインストールするパッケージのバージョンなどを確認します。
$ sudo dnf info mysql-community-server Failed to set locale, defaulting to C.UTF-8 Last metadata expiration check: 0:01:02 ago on Sun Nov 15 11:00:21 2020. Available Packages Name : mysql-community-server Version : 8.0.22 Release : 1.el8 Architecture : x86_64 Size : 53 M Source : mysql-community-8.0.22-1.el8.src.rpm Repository : mysql80-community Summary : A very fast and reliable SQL database server URL : http://www.mysql.com/ License : Copyright (c) 2000, 2020, Oracle and/or its affiliates. Under GPLv2 : license as shown in the Description field. Description : The MySQL(TM) software delivers a very fast, multi-threaded, multi-user, : and robust SQL (Structured Query Language) database server. MySQL Server : is intended for mission-critical, heavy-load production systems as well : as for embedding into mass-deployed software. MySQL is a trademark of : Oracle and/or its affiliates : : The MySQL software has Dual Licensing, which means you can use the MySQL : software free of charge under the GNU General Public License : (http://www.gnu.org/licenses/). You can also purchase commercial MySQL : licenses from Oracle and/or its affiliates if you do not wish to be bound : by the terms of the GPL. See the chapter "Licensing and Support" in the : manual for further info. : : The MySQL web site (http://www.mysql.com/) provides the latest news and : information about the MySQL software. Also please see the documentation : and the manual for more information. : : This package includes the MySQL server binary as well as related utilities : to run and administer a MySQL server.問題なければ下記コマンドでインストールを行ってください。
$ sudo dnf install mysql-community-serverインストールが完了したら下記コマンドでMySQLのバージョンを確認します。
$ mysqld --version /usr/sbin/mysqld Ver 8.0.22 for Linux on x86_64 (MySQL Community Server - GPL)MySQLを起動しましょう。
$ sudo systemctl start mysqld $ sudo systemctl status mysqld ● mysqld.service - MySQL Server Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disab> Active: active (running) since Sun 2020-11-15 11:03:45 GMT; 9s ago Docs: man:mysqld(8) http://dev.mysql.com/doc/refman/en/using-systemd.html Process: 37102 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS) Main PID: 37178 (mysqld) Status: "Server is operational" Tasks: 38 (limit: 48672) Memory: 458.6M CGroup: /system.slice/mysqld.service └─37178 /usr/sbin/mysqld Nov 15 11:03:36 iaasmysql systemd[1]: Starting MySQL Server... Nov 15 11:03:45 iaasmysql systemd[1]: Started MySQL Server.MySQLの初回起動時に
/var/log/mysqld.log
にrootユーザーの初期パスワードが記録されます。ファイルにアクセスし、パスワードの記述箇所を検索します。$ sudo cat /var/log/mysqld.log | grep password 2020-11-15T11:03:41.974831Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: PASSWORDパスワードの再設定等、セキュリティ関連の初期設定を行うために
mysql_secure_installation
を実行します。mysql_secure_installation
の設定内容をStep-by-Stepで確認しています。
はじめに、mysql_secure_installation
を起動した際は、rootユーザーの初期パスワードを聞かれるので入力して起動します。/var/log/mysqld.log
で確認したパスワードを利用します。また、rootパスワードが期限切れになっていると言われるので新しいパスワードを設定します。確認のため2回入力が必要です。$ mysql_secure_installation Securing the MySQL server deployment. Enter password for user root: The existing password for the user account root has expired. Please set a new password. New password: Re-enter new password: The 'validate_password' component is installed on the server. The subsequent steps will run with the existing configuration of the component. Using existing password for root. Estimated strength of the password: 100さらにroot ユーザーのパスワードを変更するか聞かれます。ここでも確認のため2回入力する必要があります。
Change the password for root ? ((Press y|Y for Yes, any other key for No) : y New password: Re-enter new password: Estimated strength of the password: 100 Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : y
匿名ユーザーを削除するか聞かれるので、
y
を入力し匿名ユーザーを削除します。By default, a MySQL installation has an anonymous user, allowing anyone to log into MySQL without having to have a user account created for them. This is intended only for testing, and to make the installation go a bit smoother. You should remove them before moving into a production environment. Remove anonymous users? (Press y|Y for Yes, any other key for No) : y Success.
リモートからの rootユーザーのアクセスを禁止するか聞かれるので、
y
を入力しリモートアクセスを禁止します。Normally, root should only be allowed to connect from 'localhost'. This ensures that someone cannot guess at the root password from the network. Disallow root login remotely? (Press y|Y for Yes, any other key for No) : y Success.
テストデータベースを削除するか聞かれるので、
y
を入力し削除します。By default, MySQL comes with a database named 'test' that anyone can access. This is also intended only for testing, and should be removed before moving into a production environment. Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y - Dropping test database... Success. - Removing privileges on test database... Success.
最後に権限の変更を更新するか聞かれるので、
y
を入力し更新しますReloading the privilege tables will ensure that all changes made so far will take effect immediately. Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y Success. All done!
MySQLクライアントからアクセスできることを確認します。
$ mysql -u root mysql -p Enter password: Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 13 Server version: 8.0.22 MySQL Community Server - GPL Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql>関連情報
MySQL 8.0 Reference Manual 2.5 Installing MySQL on Linux
MySQL 5.6 リファレンスマニュアル 2.5 Linux に MySQL をインストールする