Linux下快速搭建ntp时间同步服务器
一、搭建时间同步服务器
1、编译安装ntp server
wget http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2.4p4.tar.gz
tar zxvf ntp-4.2.4p4.tar.gz
cd ntp-4.2.4p4
./configure --prefix=/usr/local/ntp --enable-all-clocks --enable-parse-clocks
make && make install
注:如以上下载地址无法访问,请从ntp官方下载网页(http://www.ntp.org/downloads.html)寻找下载地址。
2、修改ntp.conf配置文件
vi /etc/ntp.conf
①、第一种配置:允许任何IP的客户机都可以进行时间同步
将“restrict default nomodify notrap noquery”这行修改成:
restrict default nomodify
配置文件示例:/etc/ntp.conf
②、第二种配置:只允许192.168.18.***网段的客户机进行时间同步
在restrict default nomodify notrap noquery(表示默认拒绝所有IP的时间同步)之后增加一行:
restrict 192.168.18.0 mask 255.255.255.0 nomodify
配置文件示例:/etc/ntp.conf
3、以守护进程启动ntpd
/usr/local/ntp/bin/ntpd -c /etc/ntp.conf -p /tmp/ntpd.pid
4、ntpd启动后,客户机要等几分钟再与其进行时间同步,否则会提示“no server suitable for synchronization found”错误。
二、配置时间同步客户机
vi /var/spool/cron/root
增加一行,在每天的5点13分、9点13分、14点13分、19点13分与时间同步服务器进行同步
13 5,9,14,19 * * * /usr/sbin/ntpdate 192.168.18.2
备注:如果客户机没有ntpdate,可以下载ntpdate.tar.gz到/usr/sbin/目录,然后解压:
wget http://blog.s135.com/attachment/200708/ntdate.tar.gz
cd /usr/sbin/
tar zxvf ntpdate.tar.gz
相关文档:
最近看了一些Linux命令行的文章,在系统信息查看方面学到不少命令。 想起以前写过的一篇其实Linux这样用更简单
,
发现这些系统信息查看命令也可以总结出一篇小小的东西来了。
另外这里
还有非常多的命令, 可以作为参考。
系统
# uname -a # 查看内核/操作系统/CPU信息
# head -n 1 /etc/issue ......
contact me go -> xuqiang.docs@hotmail.com
ARM Linux Boot Sequence
The following traces the Linux boot sequence for ARM-based systems in the 2.6.18 kernel. It looks at just the earliest stages of the boot process, until the generic non-processor-specific start_kernel function is called. The line ......
1. tr 命令的功能
tr命名是简化了的sed命令。其主要的功能包括:
a. 用一个字符来替换另外一个字符。
b. 删除字符串中的指定子串。
c. 合并字符串中重复串。
2. 常见的命令格式:
tr -c -d -s ["string1_to_translate_from"] ["string2_to_translate_to"] < input-file
-c 用字符串1中字符集的补集替换此字符集, ......
权限与文件系统安全
1,“ls -l”命令输出结果中各字段含义:
(1),文件类型,第1位(“-”普通文件、“d”目录文件、“l”符号链接文件、“b”快设备文件、“c”字符设备文件、“p”管道文件、“s”socket文件)
(2),权限,第2至10位( ......
内核,是一个操作系统的核心。它负责管理系统的进程、内存、设备驱动程序、文件和网络系统,决定着系统的性能和稳定性。Linux作为一个自由软件,在广
大爱好者的支持下,内核版本不断更新。新的内核修订了旧内核的bug,并增加了许多新的特性。如果用户想要使用这些新特性,或想根据自己的系统度身定制一
个更高效,更稳定 ......