Physical Server

FAQs Regarding Operating System

2024-12-17 07:53:08

Can users upgrade the operating system by themselves?

No. Plug-ins and hardware drivers may become unavailable when users upgrade the operating system by themselves. As a result, a physical server may run abnormally.

If you want to upgrade or patch the operating system, please submit a ticket or consult the customer support at 400-810-9889.

Can I change the operating system for a physical server?

Yes.

Users can change Windows, Linux, and CTyunOS operating systems in common bare metals and can change Linux, CTyunOS operating systems in elastic bare metals. After a physical server is created, users can reinstall the OS to change the operating system.

Does the physical server OS have a user graphical interface?

The operating system currently provided has a command line interface.

If necessary, users can start the GUI based on the operating system to manage the system.

Does the physical server OS come with an upload tool?

By default, no upload and download tool is installed on the physical server OS.

If required, users can install the rz/sz upload and download tool, or use the corresponding remote transfer tool, for example, ftp/tftp.

Does the public image of the physical server have a Swap partition?

Yes.

A Swap partition is pre-created in the public image of the physical server. A Swap partition is a special partition used for virtual memory. When the physical memory (RAM) of the system is insufficient, the operating system can swap some data in the memory into the swap partition to release the physical memory for other processes.

How do I increase the size of the Swap partition?

Users can increase the size of the Swap partition in the following steps:

Description

Before doing so, make sure you back up your system to prevent unexpected data loss.

1.         Run the following command to view information about the Swap partition of the current system:

swapon --show

free -h

2.         If the current system does not have a Swap file, you can create one. You can choose to create a Swap file in the root directory or another appropriate directory.

Take creating a 2 GB Swap file named swapfile in the root directory as an example:

sudo fallocate -l 2G /swapfile

3.         Set the file permission:

sudo chmod 600 /swapfile

4.         Set the file as a Swap partition:

sudo mkswap /swapfile

5.         Enable the Swap partition:

sudo swapon /swapfile

6.         Edit the /etc/fstab file and add the following line at the end to automatically load the Swap file upon startup:

/swapfile none swap sw 0 0

7.         To increase or decrease the size of the Swap file, use the following steps:

·           Disable the Swap file:

sudo swapoff /swapfile

·           Adjust the size of the Swap file:

sudo fallocate -l 4G /swapfile

·           Set the Swap file as a Swap partition and enable the partition:

sudo mkswap /swapfile

sudo swapon /swapfile

8.         Run the following command to verify whether the Swap partition is set correctly:

swapon --show

free -h

Description

The size of the Swap partition should be set according to your system configuration and needs. Too large Swap partition may use too much disk space and too small Swap partition may fail to meet system requirements. We recommend that you make adjustments as needed.

How do I set the password validity period for a physical server image?

If the login password for the physical server image has expired, contact the operation administrator.

If you can still log in to the physical server, you can perform the following operations to set the password validity period to avoid inconvenience due to password expiration.

1.         Log in to the physical server OS and open the /etc/login.defs file.

sudo vi /etc/login.defs

Locate the configuration item PASS_MAX_DAYS, which indicates the validity period of the password.

#   PASS_MAX_DAYS   Maximum number of days   a password may be used.PASS_MAX_DAYS   90    

2.         Change the value of the PASS_MAX_DAYS parameter in Step 1. Change PASS_MAX_DAYS to your desired password validity period. For example, if you change it to 365, the password will be valid for one year:

Sudo chage -M 365 user_name

If you want your password to be persistently valid, you can set the parameter to 99999. Here, 99999 indicates the password validity period and user_name indicates a system user.

We recommend that you configure the parameter based on actual conditions and business needs and use the command to periodically update the password validity period.

3.         Run the vi /etc/login.defs command again to check whether the configuration takes effect.

#   PASS_MAX_DAYS   Maximum number of days   a password may be used.PASS_MAX_DAYS   365    

How do I set configuration items for the SSH service?

You can select a login mode or account type for logging in to the physical server as required. If special configuration is required, perform the following operations:

1.         To disable remote login using a password, you can only log in to the physical server with a certificate to improve security. You can set the following parameters:

·           Check whether the parameter "ssh_pwauth" exists in the file "/etc/clouds/cloud.cfg". If not, add the following line and set its value to "false":

ssh_pwauth: false

·           Check the "ChallengeResponseAuthentication" parameter in the "/etc/ssh/sshd_config" file and set its value set to "no":

ChallengeResponseAuthentication no

·           Then, when you log in using a tool such as Xshell, your login with password will be denied.

2.         If remote login with the root password is allowed and the SSH permission is enabled for the user root, perform the following operations:

Description

Allowing login with the root user may cause security risks. Perform this operation with caution.

·           Open the "/etc/ssh/sshd_config" file, locate the "PasswordAuthentication" parameter, and set its value to "yes":

PasswordAuthentication yes

·           Modify the "/etc/shadow" file, add "!!" to the hash value of the password of the user root, and lock it down to avoid security risks.

It should be noted that the root permission is required to modify the SSH configuration items. You must use the vi or other editor to open the related file, modify the file, and save your change. After the changes are complete, you can restart the SSH service to take the changes into effect:

sudo service ssh restart

What can I do if the system time of a Windows-based physical server differs from the local time by 8 hours?

Possible Reasons

The Linux operating system uses the time of the CMOS chip on the motherboard as Greenwich Mean Time, and then determines the current system time according to the time zone setting. However, the Windows operating system does not work this way. The Windows system directly identifies the CMOS time as the current system time and no longer converts the time according to the time zone setting.

Solutions

1.         Log in to the Windows-based physical server operating system.

2.         Press Win + R to open the Run dialog box. Type regedit and press Enter to open the registry editor.

3.         On the Registry Editor page, expand the following paths:

HKEY_LOCAL_MACHINE   └─ SYSTEM      └─ CurrentControlSet         └─ Control            └─ TimeZoneInformation    

1.         Right-click the right area of TimeZoneInformation, and go to New > DWORD (32-bit)Value(D).

2.         Name the new DWORD value as "RealTimeIsUniversal" and double-click the value to set the value to "1".

3.         Then, restart the physical server.

4.         After the restart is complete, the physical server time is the same as the local time.

How do I change the SID value of a physical server running on Windows Server 2012?

We recommend that you do not manually change the Security Identifier (SID) because incorrect changes may cause system instability or other problems. An SID is a unique identifier that identifies objects such as users, groups, and computers in a Windows system. Changing the SID may invalidate the association between the system and applications.

If you do need to modify the SID, you can use the Sysprep tool to do so:

1.         Create a system snapshot or backup: Before making any change to the system, we recommend that you create a system snapshot or execute a full backup. In this way, you can restore to the original state if problems occur.

2.         Open the command prompt (administrator rights).

3.         Navigate to the directory of the Sysprep tool, usually at C:\Windows\System32\sysprep\.

4.         Run the following command to run the Sysprep tool:

sysprep /generalize /oobe /shutdown

Description

/generalize: Reset the system configuration.

/oobe: Run Out-Of-Box Experience (welcome screen) of Windows.

/shutdown: Shut down the computer after Sysprep is complete.

5.         System reboot: The physical server will run the Sysprep operation on the next startup. This operation will reset the system configuration and generate a new SID for the system.

How do I switch the kernel version for physical servers running on CentOS 7 series?

Background

For some special software, you must specify the Linux kernel version to support it. In this case, you must switch the kernel version.

Solutions

1.         Log in to the physical server OS.

2.         View the current kernel version.

uname -r

3.         Run the following command to list available kernel packages:

yum list kernel

4.         Install the new kernel package.

Select the new kernel package version you want to install and execute the following command to install it. It should be noted that the existing kernel will be replaced with the specific kernel version you want to install.

sudo yum install kernel-

5.         Run the following command to update the GRUB configuration and ensure that the newly installed kernel version is selected at boot.

sudo grub2-mkconfig -o /boot/grub2/grub.cfg

6.         Run the sudo reboot command to reboot the physical server, log in to the operating system again, and run the command in Step 2 to check whether the kernel version is successfully switched.

How do I update the metadata of the disk after the LVM volume is remounted?

Scenario

After the operating system is reinstalled, you must update the metadata of the disk immediately after the LVM volume is remounted to avoid failure to access the operating system at the subsequent reboot.

Operation Steps

After the operating system is reinstalled on a bare metal server that uses an LVM partition, if the LVM volume is remounted, run the following command to update the metadata of the disk after the LVM volume is mounted to ensure that the metadata is consistent with the actual mount information after the operating system is rebooted.

1.         Use commands such as lsblk or fdisk -l to view your disk information and confirm the path of the LVM volume. In general, the path of an LVM volume is similar to /dev/sdXN, where X is the disk ID and N is the partition number.

2.         Unmount the LVM volume that has been mounted. If the LVM volume is already mounted, run the umount command to unmount it. Example:

umount /dev/sdXN

3.         Run the pvresize command to update metadata of the disk. Assume that the path of the LVM volume is /dev/sdXN, run the following command:

pvresize /dev/sdXN

4.         Reactivate the LVM volume group.

vgchange -ay

5.         Run the lvscan or lvdisplay command to view the status of the LVM logical volume.

6.         If you have unmounted the LVM volume, you can now mount it again. Example:

mount /dev/mapper/VG_NAME-LV_NAME /mount_point

Wherein, VG_NAME is the name of the volume group, LV_NAME is the name of the logical volume, and /mount_point is the target path to which you want to mount.


0w2cs2OZNAjM