Contents
1.Install the FTP server vsftpd
① Install
1 |
# apt install vsftpd |
② Allow PORT21 to be used by FTP in UFW(firewall)
1 2 |
# ufw allow ftp # ufw reload |
③ Edit the configuration file (vsftpd.conf)
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 29 30 31 |
# vi /etc/vsftpd.conf # Do not allow anonymous users to log in anonymous_enable=NO # Allow login by local user account local_enable=YES # Allow the use of FTP commands to make changes to files write_enable=YES # Set the permission values to be applied to new files. local_umask=022 # Change the user's login directory to the user's root directory. chroot_local_user=YES # Users will not be able to access outside of the login directory. chroot_list_enable=YES # Users listed in the "vsftpd.chroot_list" are exempt from the above restrictions. chroot_list_file=/etc/vsftpd.chroot_list # Allow uploads by ASCII ascii_upload_enable=YES # Allow downloading by ASCII ascii_download_enable=YES # Line 131: uncomment( Enables bulk transfer of entire directories. ) ls_recurse_enable=YES |
④ Create an authorized user list file
1 2 3 |
# vi /etc/vsftpd.chroot_list xxxxxxx ← general user name |
⑤ Enable vsftpd
1 |
# systemctl restart vsftpd |
⑥ Configuring the FTP client
Open FFFTP and select Connect from the menu bar.
A window called "Host List" will open. Select a new host.
A window called "Host Settings" will open. Special clic and Enter the following and press OK.
- Profile Names(Any name)
- Host Names/Address(IP address of Ubuntu)192.168.11.100
- Usename(hoge)<General User Name>
- Password/Phrase<General user password>
You are now back at the Host List window. Please press Connect.
A window called "Save Encryption Status" will open. Select Yes.
If you can see the Windows directory on the left and the Ubuntu directory on the right, the connection is successful.
If you can't get through, turn Passive mode on and off.
2.Install NTP server and adjust time
2.1 time adjustment
① Enable timedatectl
Use the set-ntp option to enable or disable it.
1 |
# timedatectl set-ntp true |
② Check current system time
1 2 3 4 5 6 7 8 9 10 |
# timedatectl status Local time: 日 2015-06-28 00:19:26 JST Universal time: 土 2015-06-27 15:19:26 UTC RTC time: 土 2015-06-27 15:19:26 Time zone: Asia/Tokyo (JST, +0900) NTP enabled: yes ← NTP time synchronization enabled state NTP synchronized: yes ← NTP time synchronized RTC in local TZ: no DST active: n/a |
③"/usr/lib/systemd/systemd-timesyncd" daemon process status check
1 2 3 |
# systemctl status systemd-timesyncd.service ●systemd-timesyncd.service - Network Time Synchronization Loaded:loaded(/usr/lib/systemd/system/system-timesyncd.service; enabled; vendor preset: enabled) Active: active (running) since 土 2015-06-27 19:29:29 JST; 4h 57min ago Docs: man:systemd-timesyncd.service(8) Main PID: 8787 (systemd-timesyn) Status: "Using Time Server 213.239.154.12:123 (0.arch.pool.ntp.org)." CGroup: /system.slice/systemd-timesyncd.service └─8787 /usr/lib/systemd/systemd-timesyncd June 27 19:29:29 mimi systemd[1]: Starting Network Time Synchronization... June 27 19:29:29 mimi systemd[1]: Started Network Time Synchronization. June 27 20:45:20 mimi systemd-timesyncd[8787]: Timed out waiting for reply from 202.234.64.222:123 (0.arch.pool.ntp.org). June 27 20:45:30 mimi systemd-timesyncd[8787]: Timed out waiting for reply from 157.7.153.56:123 (0.arch.pool.ntp.org). |
④ Change time zone
Asia/Tokyo Specifying the time zone
View available zones
1 2 3 |
# timedatectl list-timezones Africa/Abidjan Africa/Accra |
1 |
# timedatectl set-timezone Asia/Tokyo |
1 2 3 4 5 6 7 8 9 |
# timedatectl status Local time: Sunday 2015-06-28 17:57:04 JST Universal time: Sunday 2015-06-28 08:57:04 UTC RTC time: Sunday 2015-06-28 08:57:04 Time zone: Asia/Tokyo (JST, +0900) NTP enabled: yes NTP synchronized: yes RTC in local TZ: no DST active: n/a |
2.2 NTP server: Configure NTPd
① NTP server installation
1 |
# apt -y install ntp |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
# vi /etc/ntp.conf # Line 21.:Comment the default settings and add the NTP server for your own time zone. #pool 0.ubuntu.pool.ntp.org iburst #pool 1.ubuntu.pool.ntp.org iburst #pool 2.ubuntu.pool.ntp.org iburst #pool 3.ubuntu.pool.ntp.org ibursr # Use Ubuntu's ntp server as a fallback. #pool ntp.ubuntu.com server ntp.nict.jp iburst server ntp1.jst.mfeed.ad.jp iburst server ntp2.jst.mfeed.ad.jp iburst # Line 53.:Add the range to allow time synchronization. restrict 10.0.0.0 mask 255.255.255.0 nomodify notrap |
1 |
# systemctl restart ntp |
1 2 3 4 5 6 7 |
# ntpq -p remote refid st t when poll reach delay offset jitter ============================================================================== ntp-a3.nict.go. .NICT. 1 u 1 64 1 29.497 12.191 0.000 ntp1.jst.mfeed. 133.243.236.17 2 u 2 64 1 19.361 13.572 0.000 ntp2.jst.mfeed. 133.243.236.17 2 u 2 64 1 19.172 13.462 0.201 |