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
2954  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点赞 554081浏览
随机文章
收集的一些有些历史的注入命令
13年前
nslookup命令常用方式说明
5年前
斐讯N1电视盒子接电视不能输出4K分辨率
5年前
CentOS快速安装Glances
11年前
aria2 — Linux 下载工具
12年前
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 评论 554081 浏览
测试
测试