ArchLinux : Initial settings after OS installation

1. User Account Creation

Add user (huong) to wheel group and create home directory

# useradd -m -G wheel huong

User (huong) password setting

# passwd huong
New password:
Retype new password:
passwd: password updated successfully

Grant sudo privileges to the added huong user

# vim /etc/sudoers

Per Line 123 : add
huong ALL=(ALL:ALL) ALL

2 . Configuration of the text editor vim

Vim was already installed during the Arch Linux installation, so this is just a configuration file.
If you are installing vim

# pacman -S vim

Create a new ~/.vimrc to make the vim editor easier to use

# vim ~/.vimrc
 
set encoding=utf-8
set fileencodings=utf-8,iso-2022-jp,sjis,euc-jp
set fileformats=unix,dos
set history=50
set ignorecase
set smartcase
set hlsearch
set incsearch
set number
set showmatch
set binary noeol
set autoindent
syntax on
highlight Comment ctermfg=LightCyan
set wrap

3. Network Connections

■ If using systemd-resolved, create /etc/resolv.conf as a link file

# ln -sf /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf

■ If systemd-resolved is not used
Edit /etc/resolv.conf

# vim /etc/resolv.conf
# Router DNS servers (varies by router model)
nameserver 192.168.11.1

# Google Public DNS
nameserver 8.8.8.8

4. Static IP address setting

Edit /etc/systemd/network/mynet.network, which was created during the installation process.
For example, set the IP address to "192.168.11.83
Set the network interface name "ens33" to match your environment.

# vim /etc/systemd/network/mynet.network

Describe the following contents

[Match]
 Name=ens33

[Address]
 Address=192.168.11.83/24

[Network]
 DNS=192.168.11.1

[Route]
 Gateway=192.168.11.1

Name=ens33 network interface name
DNS=192.168.11.1 Router IP Address
Gateway=192.168.11.1 Router IP Address

Reflection of settings

# systemctl restart systemd-networkd.service

5. Running 32-bit applications in a 64-bit environment

Edit the /etc/pacman.conf file so that the packages in the multilib repository are required and available

# vim /etc/pacman.conf

Delete # in lines 93-94
[multilib]
Include = /etc/pacman.d/mirrorlist

Get package list for multilib

# pacman -Syy

6. AUR Helper

Arch Linux has a useful Arch User Repository (AUR), so install the AUR Helper "yay" to use the AUR.
You cannot install it as root, so log in as a general user and install it.
Install git beforehand.

# su - huong
$ git clone https://aur.archlinux.org/yay.git
$ cd yay
$ makepkg -si

7. Time Synchronization

Install ntp as it uses ntp to get the time from an NTP server

# pacman -S ntp

Edit ntp configuration file

# vim /etc/ntp.conf

11-14 Rewrite to the server of the table of contents of line contents
# Associate to Arch's NTP pool
server 0.pool.ntp.org iburst
server 1.pool.ntp.org iburst
server 2.pool.ntp.org iburst
server 3.pool.ntp.org iburst
#server 0.arch.pool.ntp.org
#server 1.arch.pool.ntp.org
#server 2.arch.pool.ntp.org
#server 3.arch.pool.ntp.org

Enable Services

# systemctl daemon-reload
# systemctl start ntpd
# systemctl enable ntpd

Check if synchronization is running (if marked with *, it is synchronized)

# ntpq -p
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
*45.66.166.63    133.243.238.244  2 u   44   64    1   18.044  +19.161   8.664
+y.ns.gin.ntt.ne 129.250.35.222   2 u   43   64    1    5.206  +13.931   2.967
 142.91.108.61   .INIT.          16 u    -   64    0    0.000   +0.000   0.000
+time.cloudflare 10.82.8.4        3 u   41   64    1    8.259  +15.092   2.496

Thereafter, log in as the created user, and if necessary, use # su - to log in as the root user to set up the environment.
Then strengthen the firewall and SSH connection security.