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

 

转载于:https://www.cnblogs.com/timlong/p/3690356.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值