欢迎光临
我们一直在努力

如何修改VPS系统时间 Linux VPS系统同步时间和时区简单方法

有时候VPS时间会出现错乱导致网站各种问题,所以本篇文章讲述如何修改VPS系统时间。

这里需要ssh登录vps或服务器(date 可以查看时间和时区)。

第一、修改北京时区

这个是广告编辑地方

这里垃圾站博客以修改北京时间作为默认时区,如果有其他需要的,可以对应修改。

1 rm -rf /etc/localtime #先删除默认的时区设置
2 ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime #替换上海/北京作为默认

第二、手工修改当前系统的时间

1 date -s '22:55:00 2017-03-31'

这里,垃圾站就修改为当前的时间。

第三、设置同步时间

1 ntpdate us.pool.ntp.org

设置同步服务器时间,安装完毕之后,在Xshell中输入date命令测试下当前时间。

一般的VPS都有安装NTP,如果没有安装我们需要先安装yum install -y ntp(centos系统)。

总结,这样我们通过上面的3步骤就快速的实现Linux VPS系统时间与当前需要的时区和时间同步一致,确保项目的正常运行。

赞(0)
未经允许不得转载:站长电台 » 如何修改VPS系统时间 Linux VPS系统同步时间和时区简单方法
分享到: 更多 (0)

评论 11

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
  1. #1

    I just want to tell you that I am all new to blogging and site-building and seriously enjoyed your web blog. Likely I’m likely to bookmark your blog . You actually come with impressive article content. Thanks a bunch for sharing your blog site.

  2. #2

    Terrific paintings! That is the type of information that are meant to be shared around the net. Shame on the seek for no longer positioning this publish higher! Come on over and consult with my website . Thank you =)

  3. #3

    I simply wished to appreciate you all over again. I do not know what I might have undertaken in the absence of the entire basics discussed by you directly on my area. It absolutely was a real scary scenario in my view, however , taking a look at the very specialised manner you processed the issue took me to leap with joy. I’m just happy for this help as well as hope you are aware of an amazing job that you are accomplishing teaching others by way of your site. More than likely you’ve never met any of us.

  4. #4

    Keep working ,fantastic job!

  5. #5

    I think this is among the most important info for me. And i’m glad reading your article. But wanna remark on few general things, The web site style is ideal, the articles is really great : D. Good job, cheers

  6. #6

    Hey There. I found your blog using msn. This is a very well written article. I’ll be sure to bookmark it and return to read more of your useful info. Thanks for the post. I’ll certainly comeback.

  7. #7

    Lovely site! I am loving it!! Will come back again. I am taking your feeds also

  8. #8

    It is in point of fact a nice and helpful piece of info. I am satisfied that you simply shared this helpful information with us. Please stay us up to date like this. Thanks for sharing.

  9. #9

    I haven¡¦t checked in here for a while as I thought it was getting boring, but the last few posts are good quality so I guess I will add you back to my everyday bloglist. You deserve it my friend 🙂

  10. #10

    Nice blog right here! Also your web site rather a lot up very fast! What host are you the use of? Can I get your affiliate hyperlink in your host? I want my web site loaded up as quickly as yours lol

  11. #11

    What i don’t realize is in fact how you’re not really much more well-favored than you may be now. You’re so intelligent. You know therefore considerably relating to this matter, made me for my part imagine it from so many various angles. Its like women and men are not interested unless it is one thing to do with Girl gaga! Your individual stuffs outstanding. Always deal with it up!