そういうのがいいブログ
SIerで働く30代サラリーマンSEがインフラエンジニアに憧れてLinux・クラウド・AWSの勉強をするブログ
トップ > AlmaLinux > AlmaLinux8.8インストール後に最初に行う基本設定AlmaLinux8.8インストール後に最初に行う基本設定
※[PR]当ブログの記事の中にはプロモーションが含まれています。 本記事の内容- AlmaLinux8.8のインストール後に行う基本設定の手順
- 本記事の内容
- AlmaLinux8.8のインストール後に行う基本設定の手順
- 手順① selinuxの無効化
- 手順② firewalldの基本設定
- (1)管理用のゾーンを作成
- (2)管理用のゾーンにsshを許可
- (3)管理用のゾーンに接続元のIPアドレス追加
- (4)設定を反映して確認
- (5)デフォルトのpublicゾーンからsshを除去
- (6)設定を反映して確認
- (1)rootユーザーのログイン無効化
- (2)管理者ユーザーをwheelグループに追加
- (3)su でrootになれるユーザーをwheelグループに制限
- (1)PubkeyAuthenticationをyesに変更
- (2)ホームに.sshディレクトリ作成してパーミッション700に変更
- (3)鍵ファイルをアップロードしてパーミッション600に変更
- (4)Tera Termで公開鍵認証での接続テスト
- (5)従来のパスワード認証を無効化する
- (6)WinSCPの変更
- 自動更新の有効化
- テスト
- メールサーバー側の転送設定
- Rocky Linux & AlmaLinux実践ガイド
- インフラエンジニアの勉強ができるおススメ書籍
- インフラエンジニアの教科書
- 1週間でLPICの基礎が学べる本
AlmaLinux8.8のインストール後に行う基本設定の手順
手順① selinuxの無効化 [root@SV-ALTAIR ~]# getenforce Enforcing vi /etc/selinux/config # 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 ★★★disabledに変更 # SELINUXTYPE= can take one of these three values: # targeted - Targeted processes are protected, # minimum - Modification of targeted policy. Only selected processes are protected. # mls - Multi Level Security protection. SELINUXTYPE=targeted [root@SV-ALTAIR ~]# getenforce Disabled 手順② firewalldの基本設定- 管理用のゾーン managezone を追加してsshを追加
- firewalldのデフォルトのゾーン public からsshを除去
auth required pam_wheel.so use_uid の頭の # を外して有効化します。
#%PAM-1.0 auth required pam_env.so auth sufficient pam_rootok.so # Uncomment the following line to implicitly trust users in the "wheel" group. #auth sufficient pam_wheel.so trust use_uid # Uncomment the following line to require a user to be in the "wheel" group. auth required pam_wheel.so use_uid ★★★#を外して有効化 auth substack system-auth auth include postlogin account sufficient pam_succeed_if.so uid = 0 use_uid quiet account include system-auth password include system-auth session include system-auth session include postlogin session optional pam_xauth.so 手順⑥ SSH公開鍵認証に変更しパスワード認証の無効化 (1)PubkeyAuthenticationをyesに変更 vi /etc/ssh/sshd_configPubkeyAuthentication を yes に変更します。
# Authentication: #LoginGraceTime 2m PermitRootLogin no #StrictModes yes #MaxAuthTries 6 #MaxSessions 10 PubkeyAuthentication yes ★★★yesに変更 (2)ホームに.sshディレクトリ作成してパーミッション700に変更 mkdir ~/.ssh chmod 700 ~/.ssh [satonaka@SV-ALTAIR ~]$ mkdir ~/.ssh [satonaka@SV-ALTAIR ~]$ chmod 700 ~/.ssh (3)鍵ファイルをアップロードしてパーミッション600に変更 chmod 600 ~/.ssh/authorized_keys [satonaka@SV-ALTAIR ~]$ chmod 600 ~/.ssh/authorized_keys (4)Tera Termで公開鍵認証での接続テスト (5)従来のパスワード認証を無効化する vi /etc/ssh/sshd_configPasswordAuthentication を no に変更します。
# To disable tunneled clear text passwords, change to no here! #PasswordAuthentication yes #PermitEmptyPasswords no PasswordAuthentication no ★★★noに変更 (6)WinSCPの変更sudo /usr/libexec/openssh/sftp-server を設定
visudo ## Read drop-in files from /etc/sudoers.d (the # here does not mean a comment) #includedir /etc/sudoers.d satonaka ALL=(ALL:ALL) NOPASSWD: /usr/libexec/openssh/sftp-server ★★末尾に追記 手順⑦ パッケージの最新化 dnf update 自動更新の有効化 dnf install dnf-automatic vi /etc/dnf/automatic.conf [root@SV-ALTAIR ~]# dnf install dnf-automatic [root@SV-ALTAIR ~]# vi /etc/dnf/automatic.conf # Whether updates should be applied when they are available, by # dnf-automatic.timer. notifyonly.timer, download.timer and # install.timer override this setting. apply_updates = yes ★★yesに変更 systemctl enable dnf-automatic-install.timer systemctl start dnf-automatic-install.timer [root@SV-ALTAIR ~]# systemctl enable dnf-automatic-install.timer Created symlink /etc/systemd/system/timers.target.wants/dnf-automatic-install.timer → /usr/lib/systemd/system/dnf-automatic-install.timer. [root@SV-ALTAIR ~]# systemctl start dnf-automatic-install.timer [root@SV-ALTAIR ~]# systemctl status dnf-automatic-install.timer ● dnf-automatic-install.timer - dnf-automatic-install timer Loaded: loaded (/usr/lib/systemd/system/dnf-automatic-install.timer; enabled; vendor preset: dis> Active: active (waiting) since Tue 2023-06-20 22:18:17 JST; 16s ago Trigger: Wed 2023-06-21 06:49:02 JST; 8h left 6月 20 22:18:17 SV-ALTAIR systemd[1]: Started dnf-automatic-install timer. 手順⑧ root宛てのメールを転送 dnf install mailx [root@SV-ALTAIR ~]# dnf install mailx [root@SV-ALTAIR ~]# vi ~/.mailrc ~/.mailrc [root@SV-ALTAIR ~]# cat ~/.mailrc set smtp=smtp://sv-ceres.planet.space.com set from="root@sv-altair.planet.space.com" テスト [root@SV-ALTAIR ~]# echo test|mail root メールサーバー側の転送設定 [root@SV-CERES ~]# sed -i '/^root:/d' /etc/aliases [root@SV-CERES ~]# echo "root: satonaka@space.com" >> /etc/aliases [root@SV-CERES ~]# newaliases 参考書籍 Rocky Linux & AlmaLinux実践ガイドLinuxにおけるITプロ向け定番書籍がRocky Linux 8 & AlmaLinux 8に対応 Rocky Linux 8 & AlmaLinux 8の運用管理にかかわるシステム管理者を対象に、 システム管理の基礎、ネットワーク、ストレージ、パフォーマンスチューニング、 バックアップ、障害対応など、 IT現場で役立つ幅広いシステム管理手法を網羅しています。 Rocky Linux 8 & AlmaLinux 8.5対応
インフラエンジニアになるための勉強のやり方
現在の会社で直接担当している業務の中では、決まった技術しか触れないけれど、 「他にも将来役に立ちそうなインフラ技術を勉強したい」「働きながらでもできる効率的なインフラエンジニアの勉強方法を知りたい」と考えている方のために、 ①おすすめの書籍と、②おススメのオンライン学習サイトを紹介します。
インフラエンジニアの勉強ができるおススメ書籍朝の通勤時や帰宅時の電車の中や、社外打合せへの移動中などに勉強するなら、やはり書籍が一番だと思います。
インフラエンジニアの教科書膨大なトラフィックをさばくLINE社にて構築・保守を行っている現役エンジニアが記すITインフラの必須知識と経験の数々! サーバ、OS、ネットワーク機器、データセンター、購買と商談、障害対応、大規模インフラ、成長するために必要なスキルなど、基礎知識から実践まで言及。 ITインフラの世界が理解できる珠玉の1冊!
1週間でLPICの基礎が学べる本 ・AlmaLinux 8にインストールしたApache2のサイトをHTTPS化する… ・AlmaLinux8.8にrootkit検知ツール「chkrootkit」を導入する手… ・AlmaLinux8.8にHinemos7.0エージェントをインストールする手… ・Rocky Linux8.8にHinemos7.0エージェントをインストールする… ・Rocky Linux8.8のインストール後に基本設定として行うべきこ…サトナカ
東京の某SIerで働く30代サラリーマンSEです。 WEB系の会社のインフラエンジニアに憧れて独学でインフラ・クラウド・AWSの勉強をしています。 ・ 詳しいプロフィール ・ プライバシーポリシー ・ 問合せ ・ Twitter @souiunogaii ※[PR]当ブログの記事の中にはプロモーションが含まれています。- プログラミング学習 (3)
- AlmaLinux (42)
- AWS (3)
- Apache (28)
- CentOS-Linux (105)
- Certbot (2)
- Docker (3)
- GitLab (30)
- Hinemos (30)
- Jenkins (16)
- Mac (26)
- MariaDB (17)
- Mail (18)
- NETWORK (18)
- Oracle-Linux (34)
- OracleDatabase (37)
- Office (12)
- PHP (16)
- Proxmox (18)
- Rocky-Linux (9)
- Samba (16)
- UiPath (1)
- VMware-ESXi (40)
- VSCode (5)
- WindowsServer (39)
- Windows10 (68)
- WordPress (4)
- IT資格 (6)
- TOEIC (2)
- はてなブログ(カスタマイズ) (22)
- PC・パーツ・自作 (22)
- お金・投資・節約 (2)
- 仕事・働き方 (8)
- 生活・暮らし・服・靴 (20)
- About (3)