How to Connect to Your VDS Server via SSH (Complete Guide)
Step-by-step SSH connection guide for Linux VDS: PuTTY, Terminal, key-based authentication, Path Panel firewall rules, and security best practices.
Guide to setting timezones with timedatectl, configuring NTP with chrony and systemd-timesyncd, server time synchronization and verification steps on Linux servers.
Correct server time configuration is critical for log consistency, SSL certificate validation, database operations, and scheduled tasks. Incorrect time settings can lead to security vulnerabilities and application errors. This guide covers timezone and NTP configuration on Linux servers.
# View system time, hardware clock, and NTP status
timedatectl
# Example output:
# Local time: Tue 2024-01-15 14:30:00 TRT
# Universal time: Tue 2024-01-15 11:30:00 UTC
# RTC time: Tue 2024-01-15 11:30:00
# Time zone: Europe/Istanbul (TRT, +0300)
# System clock synchronized: yes
# NTP service: active
# Show current date and time
date
# Show UTC time
date -u
# Show hardware clock
sudo hwclock --show
# View current timezone
timedatectl | grep "Time zone"
# List all available timezones
timedatectl list-timezones
# Filter by region
timedatectl list-timezones | grep Europe
timedatectl list-timezones | grep America
# Set timezone
sudo timedatectl set-timezone Europe/Istanbul
sudo timedatectl set-timezone UTC
sudo timedatectl set-timezone Europe/Berlin
sudo timedatectl set-timezone America/New_York
sudo timedatectl set-timezone Asia/Dubai
# Alternative method (for older systems)
sudo ln -sf /usr/share/zoneinfo/Europe/Istanbul /etc/localtime
# Update /etc/timezone
echo "Europe/Istanbul" | sudo tee /etc/timezone
# Verify the change
date
REXE servers come with UTC timezone by default. For Turkey, use Europe/Istanbul (UTC+3). Keeping servers in UTC is also a good practice for log analysis.
NTP (Network Time Protocol) synchronizes the server clock with time servers on the internet.
The default lightweight NTP client on Ubuntu and Debian.
# Check status
sudo systemctl status systemd-timesyncd
# View NTP sync status
timedatectl show-timesync --all
# Enable NTP
sudo timedatectl set-ntp true
# Disable NTP
sudo timedatectl set-ntp false
# Edit configuration file
sudo nano /etc/systemd/timesyncd.conf
[Time]
# Primary NTP servers
NTP=0.pool.ntp.org 1.pool.ntp.org time.cloudflare.com
# Fallback NTP servers
FallbackNTP=2.pool.ntp.org 3.pool.ntp.org time.google.com
# Maximum root distance (seconds)
RootDistanceMaxSec=5
# Restart the service
sudo systemctl restart systemd-timesyncd
# Check sync status
timedatectl
Chrony offers better performance for intermittently connected or virtualized environments.
# Install chrony (Ubuntu/Debian)
sudo apt install chrony -y
# Install chrony (RHEL/CentOS/AlmaLinux)
sudo dnf install chrony -y
# Start and enable the service
sudo systemctl enable --now chronyd
# Edit configuration file
sudo nano /etc/chrony/chrony.conf # Ubuntu/Debian
# or
sudo nano /etc/chrony.conf # RHEL/CentOS
# NTP pool servers
pool 0.pool.ntp.org iburst
pool 1.pool.ntp.org iburst
# Cloudflare NTP (high precision)
server time.cloudflare.com iburst
# Google NTP
server time.google.com iburst
# Drift file
driftfile /var/lib/chrony/drift
# Log directory
logdir /var/log/chrony
# Allow large time steps on startup
makestep 1.0 3
# Sync RTC
rtcsync
# Restart the service
sudo systemctl restart chronyd
# Check chrony status
chronyc tracking
# List NTP sources
chronyc sources -v
# View source statistics
chronyc sourcestats
| Server | Description | Use Case |
|---|---|---|
pool.ntp.org | Global NTP pool | General use |
time.cloudflare.com | Cloudflare NTP | High precision |
time.google.com | Google NTP | High reliability |
time.windows.com | Microsoft NTP | Windows compatible |
# Write system time to hardware clock
sudo hwclock --systohc
# Read hardware clock to system time
sudo hwclock --hctosys
# Set hardware clock to UTC
sudo hwclock --systohc --utc
# Show hardware clock
sudo hwclock --show
# Check NTP sync status
timedatectl | grep synchronized
# Check sync with chrony
chronyc tracking | grep "System time"
# Quick check with ntpdate (if installed)
ntpdate -q pool.ntp.org
Don't run chrony and systemd-timesyncd at the same time. When installing chrony, disable timesyncd:
sudo systemctl disable --now systemd-timesyncd
# Check NTP port (UDP 123)
sudo ufw allow 123/udp
# Check chrony log
sudo tail -f /var/log/chrony/tracking.log
# Test connectivity
ntpdate -q pool.ntp.org
# Force chrony to sync
sudo chronyc makestep
# Set time manually (with NTP disabled)
sudo timedatectl set-ntp false
sudo timedatectl set-time "2024-01-15 14:30:00"
sudo timedatectl set-ntp true
# Quick fix with chrony
sudo chronyc makestep
Proper timezone and NTP configuration is a fundamental requirement for reliable server infrastructure. On REXE servers, you can keep your clock synchronized at all times using chrony or systemd-timesyncd, ensuring log consistency and application reliability.
UTC is a universal standard without daylight saving time. Keeping logs in UTC makes it easy to compare events across servers in different timezones. Timezone conversion for users can be handled at the application layer.
systemd-timesyncd is lighter and simpler, sufficient for most use cases. chrony offers more advanced features: better performance with intermittent connections, faster synchronization, and more precise clock management. chrony is recommended for virtualized environments.
First check NTP status with 'timedatectl'. Make sure UDP port 123 is open ('sudo ufw allow 123/udp'). If using chrony, check NTP sources with 'chronyc sources -v'. For large time offsets, force sync with 'sudo chronyc makestep'.
Use the regional pool from pool.ntp.org for your location. For high precision, add 'time.cloudflare.com' or 'time.google.com'. Defining multiple servers in chrony configuration increases reliability.
Yes, running applications typically read the timezone at startup. You may need to restart applications for the timezone change to take effect. Especially for databases and web servers, run 'systemctl restart' after changing the timezone.
Step-by-step SSH connection guide for Linux VDS: PuTTY, Terminal, key-based authentication, Path Panel firewall rules, and security best practices.
Complete guide to connecting to Windows Server VDS via Remote Desktop (RDP): setup steps, NLA security, Path Panel firewall rule, and troubleshooting tips.
Step-by-step guide to changing your VDS server OS via REXE panel: backup tips, supported Linux distributions and Windows Server versions explained.