Contents
1. Install NTP server
1 2 3 4 5 6 7 |
# 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 2.debian.pool.ntp.org iburst pool ntp.nict.jp iburst # Add to the last line (Range for which time synchronization is allowed) allow 192.168.11.0/24 |
Setting Reflection
1 |
# systemctl restart chrony |
Operation check
1 2 3 4 5 6 7 |
# chronyc sources MS Name/IP address Stratum Poll Reach LastRx Last sample ============================================================ ^- ntp-a3.nict.go.jp 1 6 17 1 -508us[ -508us] +/- 6101us ^- ntp-b3.nict.go.jp 1 6 17 0 +96us[ +96us] +/- 5536us ^* ntp-k1.nict.jp 1 6 17 1 -54us[ +148us] +/- 3561us ^- ntp-a2.nict.go.jp 1 6 17 1 +124us[ +124us] +/- 5638us |
2. Install FTP Server
2.1 Install Vsftpd
1 |
# apt install vsftpd |
FTP Port21 allowed
1 2 |
# ufw allow ftp # ufw reload |
2.2 Edit Vsftpd configuration file
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# vi /etc/vsftpd.conf # Line 14. : change listen=YES # Line 22 : change listen_ipv6=NO # Line 31 : Uncomment # Allow use of FTP commands to make changes to files write_enable=YES # Line 35 : Uncomment # Set permission values to be applied to new files # Each digit indicates owner, group, other, and bit indicates rwx local_umask=022 # Line 99-100 : Uncomment # Allow uploads by ASCII ascii_upload_enable=YES # Allow downloading by ASCII ascii_download_enable=YES # Line 122 : Uncomment # Change the user's login directory to the user's root directory chroot_local_user=YES # Line 123 : Uncomment # Users will not be able to access outside the login directory chroot_list_enable=YES # Line 125 : Uncomment # Users listed in vsftpd.chroot_list are exempt from the above restrictions chroot_list_file=/etc/vsftpd.chroot_list # Line 131:Uncomment( Enable batch transfer by directory ) ls_recurse_enable=YES |
Next, create a new vsftpd.chroot_list under etc.
Add your Debian username (e.g. huong) to this file.
1 2 |
# vi /etc/vsftpd.chroot_list huong |
Enable vsftpd and restart
1 |
# systemctl restart vsftpd |
2.3 Check FTP connection
Check with FTP client
In this case, we will use FileZilla.
Start FileZilla and change FileZilla settings first, menu "Edit" "Settings"
![](https://korodes.com/wp-content/uploads/2022/06/96b2041c2ab7338550104ac4a3e9540d.png)
Connection" and "SFTP" in the left pane
Click "Add key File" in the right pane
![](https://korodes.com/wp-content/uploads/2022/06/89b87fbdfec969a3395765ab989b06a9.png)
Open "id_rsa.ppk" saved in Windows
![](https://korodes.com/wp-content/uploads/2022/06/21c25f33eb73b3d795adf346e7ff0d33.png)
![](https://korodes.com/wp-content/uploads/2022/06/e400d906eb75677c4c531ecb86fe7b0f.png)
In the "Password" field, enter the password you set when you created your SSH public key.
![](https://korodes.com/wp-content/uploads/2022/06/4a3317329b07d1b078cebd2ea2a4bafd.png)
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"
![](https://korodes.com/wp-content/uploads/2022/05/2e970e5c678d9828d9c207c5a4c53a4b.png)
Password : the password you set when you created your SSH public key.
![](https://korodes.com/wp-content/uploads/2022/05/f5a202e4d740462c7b3265e446c6d7bf.png)
If the Windows directory appears on the left and the Ubuntu directory on the right, the connection is successful.
![](https://korodes.com/wp-content/uploads/2022/05/236ea3f0ec7480831b2b92d5b01735db.png)