Click here for "Safe Air Conditioner Repair and Proper Freon Recovery".

Ubuntu Server 22.04 : NTP , FTP Server(Vsftpd)

1. Install a time synchronization service NTP server

# apt -y install chrony
# vi /etc/chrony/chrony.conf
# Lines 20-23.:Comment the default settings and add the NTP server for your time zone.
#pool     iburst maxsources 4
#pool iburst maxsources 1
#pool iburst maxsources 1
#pool iburst maxsources 2
pool iburst
# Add to the last line (Range for which time synchronization is allowed)
Settings reflect
# systemctl restart chrony
# operation check
# chronyc sources
MS Name/IP address Stratum Poll Reach LastRx Last sample
^- 1 6 17 3 -79us[ -79us] +/- 5671us
^? 0 7 0 - +0ns[ +0ns] +/- 0ns
^? 0 7 0 - +0ns[ +0ns] +/- 0ns
^* 1 6 17 4 -229us[ -165us] +/- 3467us
^+ 1 6 17 4 +247us[ +311us] +/- 5348us

2. Install FTP server vsftpd


# apt install vsftpd

②Allow PORT 21 at UFW

# ufw allow ftp
# ufw reload

③Configuration File Changes

# vi /etc/vsftpd.conf

Line 14.

Line 22.

Line 25.  # Do not allow anonymous users to log in

Line 28.  # Allow login by local user accounts

Line 31.  # Allow use of FTP commands to make changes to files

Line 35.  # Set permission values to be applied to new files

Line 99.  # Allow uploads by ASCII

Line 100.  # Allow downloading by ASCII

Line 122.  # Change the user's login directory to the user's root directory

Line 123.  # Users will not be able to access outside the login directory

Line 125.  # Users listed in vsftpd.chroot_list are exempt from the above restrictions

Line 131.  #Comments Unsubscribe( Enable batch transfer by directory)


# vi /etc/vsftpd.chroot_list
# Fill in only the user name (huong) in the new file and finish saving.

⑤Restart vsftpd

# systemctl restart vsftpd

⑥Check with FTP client
In this case, FileZilla will be used.
Open the ftp port with firewall before connecting

# firewall-cmd --permanent --add-service=ftp
# firewall-cmd –reload
Start FileZilla and change FileZilla settings first, menu "Edit" "Settings
"Connection" and "SFTP" in the left pane
Click "Add key File" in the right pane
Open "id_rsa.ppk" saved in Windows
Click "OK
In the "Password" field, enter the password you set when you created your SSH public key.
Return to the initial screen and select "Site Manager" from the "File" menu.

Click on "New site"
Protocol : SFTP-SSH File Transfer Protocol
Host : Server IP Address
Port : SSH port number
Logon Type : Ask for password
User : Logged-in user name
Click "Connect"

Password : Password for logged-in user

If the Windows directory appears on the left and the Ubuntu directory on the right, the connection is successful.