Post

Ubuntu Server Management - Time Settings & User Management

Ubuntu Server Management - Time Settings & User Management

This document introduces essential commands for time management and user management on Ubuntu Server.


1. Time Management

Check Current Status

1
timedatectl

Change Timezone

Example: To change to Seoul(KST)

1
2
3
4
5
# Search for Seoul in the available timezone list
timedatectl list-timezones | grep Seoul

# Set timezone
sudo timedatectl set-timezone Asia/Seoul

Ubuntu Server uses systemd-timesyncd by default. However, for servers requiring high precision (e.g., databases, clusters), dedicated services like Chrony or NTPd are preferred.

Important: Do not run multiple time services simultaneously (e.g., timesyncd + chrony). This will cause conflicts.

Automatically synchronize time with internet servers(systemd-timesyncd):

1
2
3
4
5
# Enable default synchronization
sudo timedatectl set-ntp on

# Check status
systemctl status systemd-timesyncd

Manual Time Setting

You must disable NTP before manually setting the time.

1
2
3
4
5
6
7
8
9
10
# Disable NTP
sudo timedatectl set-ntp off

# Set time (Format: YYYY-MM-DD HH:MM:SS)
sudo date -s "2025-12-17 14:30:00"
# Or
sudo timedatectl set-time "2025-12-17 14:30:00"

# Synchronize hardware clock
sudo hwclock --systohc

2. User Management

Add/Remove Users

Sudo privileges are required to modify users.

1
2
3
4
5
6
7
8
# Add user
sudo adduser {USER NAME}

# Delete user
sudo userdel {USER NAME}

# Delete user + remove home directory (Recommended)
sudo userdel -r {USER NAME}

Change Password

1
sudo passwd {USER NAME}

Grant sudo Privileges

1
sudo usermod -aG sudo {USER NAME}
This post is licensed under CC BY 4.0 by the author.