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
    • 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
380  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
163文章 10评论 2点赞 80580浏览
随机文章
Squid3.0安装
9年前
Nginx+Spawn-fcgi+web.py
11年前
硬盘再次悲剧
10年前
最近弄的一个网站
9年前
CentOS通过命令导入导出MySQL备份文件
7年前
Tags
Apache CentOS CMD DDOS Debian DNS FastCGI Google IIS IP iptables Linux Mac MySQL Nginx Opensource PHP Python Skill Spawn-FCGI SSH Ubuntu Vim VMware VPN web.py Windows 删除 命令 命令提示符 安装 开源 技巧 插件 漏洞 百度 系统 组件 终端 缓存 网络电话 脚本 自建 详解 错误
Meta
  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org
Copyright © 2021
Designed by hankin
主页
页面
  • About
博主
ProdigYu 管理员
Something about myself
163 文章 10 评论 80580 浏览
测试
测试