Debian11.3 : NTP , FTP(Vsftpd) install

1. Install NTP server

# apt -y install chrony
# vi /etc/chrony/chrony.conf
# Line 8.:Comment the default settings and add the NTP server for your time zone.
#pool iburst
pool iburst
# Add to the last line (Range for which time synchronization is allowed)
Setting Reflection
# systemctl restart chrony
# operation check
# chronyc sources
MS Name/IP address Stratum Poll Reach LastRx Last sample
^- 1 6 17 1 -508us[ -508us] +/- 6101us
^- 1 6 17 0 +96us[ +96us] +/- 5536us
^* 1 6 17 1 -54us[ +148us] +/- 3561us
^- 1 6 17 1 +124us[ +124us] +/- 5638us

2. Install FTP Server

2.1 Install vsftpd

# apt install vsftpd
FTP Port21 allowed
# ufw allow ftp
# ufw reload

2.2 Edit Vsftpd configuration file

# vi /etc/vsftpd.conf
# Line 14. : change
# Line 22 : change
# Line 31 : Uncomment
# Allow use of FTP commands to make changes to files
# Line 35 : Uncomment
# Set permission values to be applied to new files
# Each digit indicates owner, group, other, and bit indicates rwx
# Line 99-100 : Uncomment
#Allow uploads by ASCII
# Allow downloading by ASCII
# Line 122 : Uncomment
# Change the user's login directory to the user's root directory
# Line 123 : Uncomment
# Users will not be able to access outside the login directory
# Line 125 : Uncomment
# Users listed in vsftpd.chroot_list are exempt from the above restrictions
# Line 131:Uncomment( Enable batch transfer by directory )

Next, create a new vsftpd.chroot_list under etc.
Add your Debian username (e.g. huong) to this file.

# vi /etc/vsftpd.chroot_list

Enable vsftpd and restart

# systemctl restart vsftpd

2.3 Check FTP connection

Open the ftp port with firewall before connecting
# firewall-cmd --permanent --add-service=ftp
# firewall-cmd –reload

Check with FTP client
In this case, we will use FileZilla.
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" and then
Protocol : SFTP-SSH File Transfer Protocol
Host : Server IP Address
Port : SSH port number
Logon Type : Ask for password
User : Login User Name
Click "Connect"

Password : Login user password

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