Ubuntu Server23.04 ; Initial setup after OS installation

1. Set root password and use SU command

In the default configuration of Ubuntu, the root user is unavailable because no password has been set.
By setting a password for the root user, transitions using the traditional [su] command will be possible.

Switch to root user

2. System Modernization

3. Make locate command available

The find command is often used to search for specific files throughout the Linux system, but find is somewhat confusing in terms of specifying options.
The locate command can extract all files with a specified filename.

3.1 Installing the locate package

3.2 Example of executing the locate command

4. vim editor settings

Ubuntu has vim installed by default

4.1 Change vim settings

There may be cases where you do not want to allow vim settings for all users. In such cases, a ".vimrc" file can be created in each user's home directory to change the vim environment for each user.
In this case, we will create a ".vimrc" file in the root user's home directory "/root/" and apply it to all users.

Select the above settings according to your preference.

5. Network Settings

5.1 Host Name Settings

This procedure is not necessary if you have already set the hostname at the time of Ubuntu installation and wish to use the hostname as it is.
To change the hostname, use the "hostnamectl set-hostname" command.
As an example, we set "ubuntu-10" as the hostname.

5.2 Set IP address to network interface

If a fixed IP address was specified during Ubuntu installation, this section is not necessary.
To change the IP address, change the " /etc/netplan/00-installer-config.yaml" file, and then restart the network interface (enp0s3 in this environment).
The network interface name will change depending on the environment in which the setup was performed, so check the interface name first.

enp0s3 : network interface name
192.168.11.83 : IP address

5.2.1 Setting up a static IP address
For this example, we will fix the IP address to 192.168.11.63. The required network information is as follows, which is reflected in the configuration file.
Address : 192.168.11.63/24
Default gateway : 192.168.11.1
Name server : 192.168.11.1
IP addresses are configured by changing the " /etc/netplan/00-installer-config.yaml" file.

5.2.2 Disabling IPv6

6. Configure server time synchronization

Configure "timesyncd", a service that automatically adjusts the server time.

6.1 Configuration of timesyncd service

Before changing a file, make a backup copy of the original file

Edit configuration file

↓ change

6.2 Reflection of timesyncd service settings

If "System clock synchronized: yes" is displayed, the time is synchronized.

6.3 Set time zone to Japan

In the above, Time zone: Etc/UTC (UTC, +0000), so it matches Japan (Asia/Tokyo).

As above, it is in Japan.

Copied title and URL