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
  • 友链
    • 维酷科技
    • Tesra超算网络
Help?

Please contact us on our email for need any support

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

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

2012-09-12 19:11:56
2988  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
180文章 77评论 4点赞 561198浏览
随机文章
Win10系统不能自动关闭显示器
4年前
VestaCP小百科
9年前
如何绕过宝塔强制绑定帐号
4年前
用netstat和awk命令来统计网络连接数
14年前
总结Apache 2.2.X 动态添加mod_perl
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
180 文章 77 评论 561198 浏览
测试
测试