User-Profile-Image
hankin
  • 5
  • 首页
  • 分类
    • Windows
    • Web
    • VoIP
    • Virtualization
    • Trading
    • Smart Home
    • SEO
    • Security
    • Python
    • Program
    • PHP
    • OSX
    • OS
    • OpenSource
    • Nginx
    • MySQL
    • Mood
    • Linux
    • Life
    • Injection
    • Hosting
    • Finance
    • Exploits
    • CDN
  • 页面
    • About
  • 友链
    • 维酷科技
Help?

Please contact us on our email for need any support

Support
  • 首页
    首页   ›   OS   ›   Linux   ›   正文
Linux

SSH修改调整美国Linux VPS 时间和时区

2012-09-12 19:11:56
3351  0 0

大部分朋友都喜欢用美国的 VPS 主机,原因嘛,大家懂的。美国的vps大多都是国外的时间,让我们的程序总是不适应。那么如何调整linux的时间为北京时间?修改linux vps的时间和时区,有什么办法?

首先,需要ssh登录vps或服务器。 date 命令可以查看时间和时区。然后输入以下命令:
rm -rf /etc/localtime
ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

再date查看下时间和时区,时间是否正确了。如果已经正确,那么OK搞定。 SSH操作范例:
root@prodigyu.com~]# date
Thu May 6 02:01:52 UTC 2010
[root@prodigyu.com~]# rm -rf /etc/localtime
[root@prodigyu.com~]# ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
[root@prodigyu.com~]# date
Thu May 6 10:02:32 CST 2010

如果还是有些不对,那么需要用命令 ntpdate stdtime.sinica.edu.tw 来校准时间。ntpdate stdtime.sinica.edu.tw 如果提示无此命令,那么需要先安装 ntpdate

CentOS 安装方法:
yum -y install ntpdate ntp
Ubuntu安装方法:
sudo apt-get install -y ntpdate ntp

ProdigYu
181文章 25评论 5点赞 641868浏览
随机文章
解决Mac终端连接SSH出现警告
11年前
让WordPress加载时间大幅降低的有效优化方式-Redis
6年前
Curl命令详解,使用方法
13年前
Mac环境下解决SSH超时断开
11年前
I’m come back.
15年前
Tags
Apache CentOS CMD DDOS Debian DNS Docker FastCGI Google IIS IP iptables Linux Mac MySQL Nginx Opensource PHP Python Skill SSH Ubuntu Vim VMware VPN web.py Windows 删除 命令 命令提示符 安装 开源 技巧 插件 漏洞 百度 系统 组件 终端 缓存 网络电话 脚本 自建 详解 错误
Meta
  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org
Copyright © 2025
主页
页面
  • About
博主
ProdigYu 管理员
Something about myself
181 文章 25 评论 641868 浏览
测试
测试