> For the complete documentation index, see [llms.txt](https://close.gitbook.io/yun-wei-bi-ji/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://close.gitbook.io/yun-wei-bi-ji/centos/linux-ji-cao/ntpdate-wu-fa-tong-bu-shi-jian-wen-ti.md).

# ntpdate 无法同步时间问题

## ntpdate同步时间出现的问题：

```bash
May 11:28:22 ntpdate[7728]: no server suitable for synchronization found
```

* 原因: 托管服务提供商正在阻止 ntp 数据包。为了应对 DDoS 攻击，一些 ISP 已经实施了这种严厉的方法

### 同步方案一：

```bash
sudo date -s "$(curl http://s3.amazonaws.com -v 2>&1 | \
  grep "Date: " | awk '{ print $3 " " $5 " " $4 " " $7 " " $6 " GMT"}')"
```

### 同步方案二：

```bash
sudo date -s "$(wget -qSO- --max-redirect=0 google.com 2>&1 | grep Date: | cut -d' ' -f5-8)Z"
```

### 同步方案三：

```python
安装  htpdate, 使用此包同步
```
