ubuntu环境配置

网络配置

主要文件:/etc/network/interfaces,这里是IP、网关、掩码等的一些配置;

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.1.11
netmask 255.255.255.0
gateway 192.168.1.1

/etc/resolv.conf这个文件保存DNS的有关信息

domain localdomain
search localdomain
nameserver 114.114.114.114
nameserver 8.8.8.8

时间配置

安装ntp服务

sudo apt-get install ntp  #服务端程序

sudo apt-get install ntpdate  #客户端程序

主配置文件:/etc/ntp.conf

server ntp.ubuntu.com

server 0.ubuntu.pool.ntp.org

server 1.ubuntu.pool.ntp.org

server 2.ubuntu.pool.ntp.org

server 3.ubuntu.pool.ntp.org

配置时区的命令是:
$sudo dpkg-reconfigure tzdata 
它会改这两个文件:
1. /etc/timezone
2. /etc/localtime
第一个文件写的是系统的时区, 我的是: Asia/Shanghai
第二个文件还可以这样改:
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

 

posted @ 2014-04-25 23:11  TIMLONG  阅读(294)  评论(0编辑  收藏  举报