LoginSignup
0
0

More than 1 year has passed since last update.

インストール直後にやることメモ

Last updated at Posted at 2019-10-26

インストール直後にする(自分の)儀式をまとめる。
基本ローカルネットワーク運用を前提としています。

CentoS7編

パッケージアップデート

何も考えずに全パッケージアップデート。

# yum update 
# reboot

net-toolsインストール

ipコマンドでもいいのですが、ifconfig使いたいおじさんなのでインストールしておきます。

# yum install net-tools

firewalld停止

ローカル運用なのでがばがばにしときます。

# systemctl stop firewalld
# systemctl disable firewalld

SELinux無効化

設定ファイルの変更は書き換える場所を間違ると悲惨なので注意する。

# getenforce
# setenforce 0
# getenforce
# vi /etc/selinux/config
 → SELINUX=disabled
# reboot

IPアドレス設定

(IPv4設定)
# nmcli c m eth0 ipv4.addresses 192.168.YYY.ZZZ/24
# nmcli c m eth0 ipv4.method manual
# nmcli c m eth0 ipv4.gateway 192.168.YYY.1
# nmcli c m eth0 ipv4.may-fail no
# nmcli c m eth0 ipv4.dns 8.8.8.8

(IPv6無効化)
# nmcli c m eth0 ipv6.method ignore

CenOS8編

CentOS8はアレですがStreamを使います。

パッケージアップデート

何も考えずに全パッケージアップデート。

# dnf update 
# reboot

net-toolsインストール

ipコマンドでもいいのですが、ifconfig使いたいおじさんなのでインストールしておきます。

# dnf install net-tools

firewalld停止

ローカル運用なのでがばがばにしときます。

# systemctl stop firewalld
# systemctl disable firewalld

SELinux無効化

設定ファイルの変更は書き換える場所を間違ると悲惨なので注意する。

# getenforce
# setenforce 0
# getenforce
# vi /etc/selinux/config
 → SELINUX=disabled
# reboot

IPアドレス設定

(IPv4設定)
# nmcli c m eth0 ipv4.addresses 192.168.YYY.ZZZ/24
# nmcli c m eth0 ipv4.method manual
# nmcli c m eth0 ipv4.gateway 192.168.YYY.1
# nmcli c m eth0 ipv4.may-fail no
# nmcli c m eth0 ipv4.dns 8.8.8.8

(IPv6無効化)
# nmcli c m eth0 ipv6.method ignore

SSH鍵認証設定

ssh-keygeでは-mオプションでPEM形式を指定しないとOPENSSHのフォーマットで作成されてしまう。

# su - admin
# ssh-keygen -t rsa -b 4096 -m PEM
# ls -la .ssh/
# ssh-copy-id admin@xxx.xxx.xxx.xxx
 → ユーザのパスワードを求められるので入力する。
→ id_rsaを取得する
0
0
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
0
0