Configuring the NTP Service (Linux)
This section describes how to configure the NTP service on the Linux server, import the NTP certificate and configure the NTP parameter on DeviceManager, and enable the storage system to normally synchronize time.
Configuring an NTP Service on the Server
This section describes how to log in to the CLI of a storage device through a management network port of a server running Linux for device management and maintenance.
Prerequisites
- The maintenance terminal has been connected to the server through a management network port.
- GNU Compiler Collection (GCC) has been installed on the server running Linux.
Context
This section uses PuTTY as an example. You can download PuTTY from chiark website.
Procedure
- Run PuTTY.
The PuTTY Configuration dialog box is displayed, as shown in Figure 10-24.
- Select Session. In Host Name (or IP address) of the Specify the destination you want to connect to area, enter the IP address of the Linux server's management network port that connects to the maintenance terminal and set Connection type to SSH.
- Click Open. The CLI login page is displayed, as shown in the following:
login as:
- Enter the user name and password as prompted. The following figure shows the result of a successful login.
Last login: Mon Apr 10 10:38:06 2017 from XXX.XXX.XXX.XXX [storage ~]#
- Create the directory for saving certificate and private key files.
- Run the cd /etc command to open etc file.
- Run the mkdir ntp_config command to create ntp_config file.
The execution result is as follows:
Storage:~ # cd /etc/ Storage:/etc # mkdir ntp_config
- Generate the certificate and private key file.
- Run the cd ntp_config to open ntp_config file.
- Run the ntp-keygen -c RSA-SHA256 -m 2048 -p server_password -T -H -l 3650 command to generate the private key file.
server_password is the private key encryption password when the certificate is generated. 3650 indicates the validity period and is variable.
The execution result is as follows:
Storage:/etc # cd ntp_config Storage:/etc/ntp_config # ntp-keygen -c RSA-SHA256 -m 2048 -p server_password -T -H -l 3650 Using OpenSSL version OpenSSL 0.9.8j-fips 07 Jan 2009 Using host Storage group Storage Generating RSA keys (2048 bits)... RSA 0 100 191 1 2 6 3 1 2 Generating new host file and link ntpkey_host_Storage->ntpkey_RSAhost_Storage.3707466522 Using host key as sign key Generating new certificate Storage RSA-SHA256 X509v3 Basic Constraints: critical,CA:TRUE X509v3 Key Usage: digitalSignature,keyCertSign X509v3 Extended Key Usage: trustRoot Generating new cert file and link ntpkey_cert_Storage->ntpkey_RSA-SHA256cert_Storage.3707466522 Storage:/etc/ntp_config #
If a message shows that the parameter -1 is not supported, upgrade the NTP on the server to a version later than 4.2.8.
- Run the ls command to check the generated file.
The execution result is as follows:
Storage:/etc/ntp_config # ls ntpkey_RSA-SHA256cert_Storage.3707466522 ntpkey_RSAhost_Storage.3707466522 ntpkey_cert_Storage ntpkey_host_Storage
- Run the hostname command to obtain the host name.
This section uses the host name Storage as an example.
- Run the vi /etc/ntp.conf command to modify the NTP configuration file.
Add the following information at the beginning of the ntp.conf file:
crypto pw server_password host Storage ident Storage
keysdir /etc/ntp_config
server_password is the private key encryption password used in generating the certificate (which can be specified by the user), Storage is the host name, and /etc/ntp_config is the directory where the certificate and private key files are saved.
- Restart the NTP service.
- For SUSE operating system, Run /etc/init.d/ntp restart command.
- For Red Hat operating system, Run systemctl restart ntpd.service command.
If multiple NTP servers need to be configured, you can copy ntpkey_cert_Storage and ntpkey_host_Storage files generated in Step 6 to the corresponding directory of other NTP servers and change the file permission to be the same as on the original server. Configure the ntp.conf file under this server and restart the NTP service.
- Configure the samba user.
- Input the cd /etc/init.d command and press Enter to enter the etc/init.d directory.
- Input the ./smb start command and press Enter to enable the SMB service.
- Add the samba user and set a password. The following figure uses user root as an example. Run the smbpasswd -a root command to add user root.
- Run the vi /etc/samba/smb.conf command and press Enter. In the opened file, add the following codes to change the user samba permission.
[ntp_config]
public=no
path=/etc/ntp_config
write list=@root root
writable=yes
In write list=@root root, the root and root are the account and password of the samba user that were just added. Set the codes as required.
Configuring NTP Parameters on the Storage System
If the time of a storage system is inaccurate, adjust it. In this way, when alarms are generated, you can accurately determine the alarm generation time based on alarm logs. This section describes how to set the NTP service on the maintenance terminal and enable the storage system to synchronize the server time.
Prerequisites
- The IP address of a network time protocol (NTP) server has been obtained.
- You have obtained the samba user name and password for logging in to the NTP server.
- You have configured the maintenance terminal with a Windows operating system.
- The maintenance terminal communicates with the storage properly.
- If the storage system has been added to a domain, the NTP server communicates with the domain server properly, and NTP synchronization has been completed.
Procedure
- Obtain the certificate from the NTP server and copy it to the maintenance terminal.
- On the maintenance terminal, press Win+R.
The Run dialog box is displayed.
- Enter \\NTP server IP address and click OK.
The maintenance terminal attempts to remotely access the NTP server.
- Enter the samba Username and Password for logging to the NTP server and click OK to enter the shared directory.
- Enter the ntp_config folder and select the NTP certificate that contains the ntpkey_cert field and press Ctrl+C to copy the certificate.
- Go back to the maintenance terminal desktop and press Ctrl+V to copy the NTP certificate to the maintenance terminal.
- Select the NTP certificate file, right-click, select Rename in the shortcut menu, add the .crt extension to the file, and click Enter.
- On the maintenance terminal, press Win+R.
- Log in to DeviceManager through the maintenance terminal.
- Import and activate the signed certificate.
- Choose Settings > Storage Settings > Value-added Service Settings > Credential Management.
- Click Import and Activate.
The Import Certificate dialog box is displayed.
- In Certificate Type, select NTP certificate.
- Click Select next to CA Certificate File.
In the dialog box that is displayed, find the NTP file directory, select the NTP certificate, and click Open.
- Click OK.
The security alert dialog box is displayed.
- Confirm the information of the dialog box and select I have read and understand the consequences associated with performing this operation, and then click OK.
The Success dialog box is displayed.
- Click OK.
The certificate list shows imported certificates.
- Configure the NTP parameter.
- Choose Settings > Basic Information > Device Time.
- Select Set NTP automatic synchronization.
- Type the IPv4 address, IPv6 address or domain name of the NTP server in NTP Server Address.
- A maximum of two NTP servers can be added. If the time of the one NTP server cannot be automatically synchronized to devices, the system synchronizes the time of another NTP server to devices.
- Ensure that the time of two NTP servers is consistent.
- In NTP Authentication, select Enable.
Some device models do not support this function. Only when NTPv4 or later is used, NTP authentication can be enabled to complete identity authentication for the NTP server and automatically synchronize the system clock to storage devices.
- Confirm the NTP configuration.
- Click Save.
The Warning dialog box is displayed.
- Confirm the information in the dialog box and select I have read and understand the consequences associated with performing this operation.
- Click OK.
The Execution Result dialog box is displayed, indicating that the operation succeeded.
- Click Close.
- Click Save.