Click here for "Error Codes for Commercial Air Conditioners".

Ubuntu Server 20.04 Initial setup

1. Set the root password and use the SU command

In the default Ubuntu configuration, the root user is disabled because no password is set.
By setting a password for the root user, the traditional [su] command can be used for transitions

$ sudo passwd root
[sudo] password for <user名> ← Current user’s password
Enter new UNIX password: ← Enter the root user password to be set
Retype new UNIX password: ← Enter your password again
passwd: password updated successfully

Switch to root user
$ su –
Password:<The password you have set above>

2. Modernisation of the system

# apt update
# apt upgrade

3. Make the locate command available

The find command is often used to search for a specific file on the whole Linux system, but find is somewhat confusing in its options.
The locate command is capable of extracting all files with a given filename.

3.1 Install locate package

# apt install -y mlocate
Check your package
# dpkg -l | grep mlocate
ii mlocate 0.26-3ubuntu3 amd64 quickly find files on the filesystem based on their name

3.2 Example of the locate command

# mlocate sshd (or # locate sshd)
You will see a list of filenames containing sshd, as shown above

4. vim editor settings

Ubuntu comes with vim installed by default

4.1 Change vim settings

If you don’t want to allow all users to set their own vim preferences, you can create a “.vimrc” file in the user’s home directory that allows you to change the vim environment for each user.
This time we will create a “.vimrc” file in the root user’s home directory “/root/” and set it to apply to all users.

# vi ~/.vimrc
※Add the following to the contents of the file
” Paste and copy
set clipboard+=autoselect
” Using vim’s own extensions
set nocompatible
” Specify the charset
set encoding=utf-8
” Specify file encoding
set fileencodings=utf-8,iso-2022-jp,sjis,euc-jp
” Specify a newline code for automatic recognition
set fileformats=unix,dos
” Get a backup       ” No backup taken  [ set nobackup ]
set backup
” Specify the directory from which to take a backup
set backupdir=~/backup
” Number of generations to keep search history
set history=50
” Case insensitive search
set ignorecase
” If you mix capital letters in your search terms, the search will be case sensitive
set smartcase
” Highlight words that match your search term
set hlsearch
” Use incremental search(Start searching for matching strings at any time while entering search terms)
set incsearch
” Display line numbers    Don’t show line numbers [ set nonumber ]
set number
“Making newlines ( $ ) and tabs ( ^I ) visible
set list
” Highlight the corresponding parentheses when typing
set showmatch
” No newline marks at the end of files
set binary noeol
” Enable auto-indent    Do not enable [ noautoindent ]
set autoindent
” Colour coding by syntax    No colour coding  [ syntax off ]
syntax on
” Change the colour of the comment text when [ syntax on ].
highlight Comment ctermfg=LightCyan
” Wrap lines with window width  Do not call back [ set nowrap ]
set wrap

The above settings can be selected according to preference.

5. Network settings

5.1 Host name settings

If you set a hostname when you install Ubuntu and use that hostname, you do not need to follow this procedure.
To change the hostname, use the command “hostnamectl set-hostname”.
As an example, here we will set “ubuntu-10” as the hostname.

# hostnamectl set-hostname ubuntu-10
Checking the results of the configuration
# cat /etc/hostname

5.2 Setting IP addresses for network interfaces

If you specified a static IP address during Ubuntu installation, this section is not necessary.
If you want to change the IP address, change the file ” /etc/netplan/00-installer-config.yaml” and reboot the network interface (eno1 in this environment).
The name of the network interface will vary depending on your environment, so check the interface name first.

Check network information
# ip addr

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eno1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 00:0c:29:b7:36:94 brd ff:ff:ff:ff:ff:ff
inet brd scope global ens33
valid_lft forever preferred_lft forever
inet6 fe80::20c:29ff:feb7:3694/64 scope link
valid_lft forever preferred_lft forever

What you see in red is the “Network Interface Name” and the “Current IP Address”.
eno1:Network interface name : IP address

5.2.1 Setting a static IP address
This time, fix the IP address to
The network information required is as follows, which should be reflected in the configuration file.

subnet mask :
default gateway :
name-server :

The configuration of the IP address is done by modifying the file ” /etc/netplan/00-installer-config.yaml”.

Disable the installer default settings and back them up
# mv /etc/netplan/00-installer-config.yaml /etc/netplan/00-installer-config.yaml.bak
Create a new installer configuration file
# vi /etc/netplan/01-netcfg.yaml
# This is the network config written by ‘subiquity’
version: 2
# Reflect settings
# netplan applye

5.2.2 Disable IPv6

# echo “net.ipv6.conf.all.disable_ipv6 = 1” >> /etc/sysctl.conf
# sysctl -p
net.ipv6.conf.all.disable_ipv6 = 1

6. Configuring server time synchronisation

Configure “timesyncd”, a service that automatically sets the server’s time.

6.1 Configuring the timesyncd service

Before making any changes to a file, make a backup copy of the original file
# cp -p /etc/systemd/timesyncd.conf /etc/systemd/
Edit configuration file
# vi /etc/systemd/timesyncd.conf
#PollIntervalMaxSec=2048 [Time]
↓ Change

6.2 Reflection of timesyncd service settings

# systemctl restart systemd-timesyncd

Check time synchronisation
# timedatectl status
Local time: Tue 2021-12-14 10:46:50 UTC
Universal time: Tue 2021-12-14 10:46:50 UTC
RTC time: Tue 2021-12-14 10:46:50
Time zone: Etc/UTC (UTC, +0000)
System clock synchronized: yes
NTP service: active
RTC in local TZ: no

If the message “System clock synchronized: yes” is displayed, time synchronization has taken place.

6.3 Set timezone to Japan

In the above example, the time zone: Etc/UTC (UTC, +0000) is set to Japan (Asia/Tokyo).

# timedatectl set-timezone Asia/Tokyo
# timedatectl status
Local time: Tue 2021-12-14 19:54:36 JST
Universal time: Tue 2021-12-14 10:54:36 UTC
RTC time: Tue 2021-12-14 10:54:36
Time zone: Asia/Tokyo (JST, +0900)
System clock synchronized: yes
NTP service: active
RTC in local TZ: no

As above, this is Japan!