ラベル OS の投稿を表示しています。 すべての投稿を表示
ラベル OS の投稿を表示しています。 すべての投稿を表示

CentOS 初期設定

■IPAddressの割り当て
 #nmcli c m ens192 ipv4.method manual ipv4.address 172.22.xxx.xx/24 connection.autoconnect yes
■Default Gateway の割り当て
#nmcli c modify ens192 ipv4.gateway 172.22.130.254
■DNS の割り当て
#nmcli connection modify ens192 ipv4.dns 172.22.130.1
■NetworkManagerの再起動
#systemctl restart network
#nmcli d show
■OS Update
# yum update
■Firewalld設定
#firewall-cmd --zone=public --add-service=https --permanent
#firewall-cmd --list-all
■NTP設定
#date
#yum install ntp
#vi /etc/ntp.conf
#systemctl restart ntpd
#ntpq -p
■SELinuxの無効化
# vi /etc/sysconfig/selinux
=========================================================
# 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 three two values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected.
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted
=========================================================

CentOSコマンド履歴とログ取得

Linuxのサーバーを設定していると、何の設定をしたのかまとめたいですよね。
そんな時にすぐ使えるコマンドをご紹介します。

【script】CUIに表示されたものを保存

root@ubuntu:~# systemctl status |grep docker
           │ │   └─26867 grep --color=auto docker
             ├─docker.service
             │ └─1232 /usr/bin/dockerd -H unix://
             │ ├─647 avahi-daemon: running [modocker.local]
root@ubuntu:~# exit
exit
スクリプトを終了しました。ファイルは log.txt です

【history】コマンドの履歴

 root@ubuntu:~#history
88  docker ps
 113  history |grep docker
root@ubuntu:~# 

設定内容のログを管理する為に便利な為これからも使っていきたいと思います。
body .syntaxhighlighter { margin: 5px 0; border: 1px dashed rgb(47, 111, 171); padding: 1em; width: calc(100% - 2em) !important; }