1、使用tzselect命令查找需要的时区,操作步骤如下:
执行tzselect命令-->选择Asia-->选择China-->Beijing Time
请输入图片描述

请输入图片描述

请输入图片描述

请输入图片描述

最终会提示操作命令,如下图:
请输入图片描述

You can make this change permanent for yourself by appending the line
TZ='Asia/Shanghai'; export TZ
to the file '.profile' in your home directory; then log out and log in again.
Here is that TZ value again, this time on standard output so that you
can use the /usr/bin/tzselect command in shell scripts:
Asia/Shanghai

2、设置系统时区,执行如下命令

TZ='Asia/Shanghai'; export TZ

3、设置永久生效

rm -f /etc/localtime
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

完毕,之后就算重启机器也没问题了。