Ubuntu 16.04.2_64系统配置
转载:http://www.cnblogs.com/yangchongxing/p/9049897.html
Ubuntu Server服务指南:https://help.ubuntu.com/16.04/serverguide/index.html
准备事项
虚拟机网络选择桥接模式、如果使用的是无线网络,则配置适配器为自己的无线网络。
网络ping -c 192.168.1.181
查看netstat -rn
重启reboot、关机shutdown -h now
1、启用root用户
$sudo passwd root
输入两次密码就OK了。
扫描二维码关注公众号,回复:
888719 查看本文章
![](/qrcode.jpg)
2、安装VIM
#apt-get install vim
3、安装ssh
#apt-get install ssh
启用root ssh连接
# vim /etc/ssh/sshd_config
修改如下部分,允许root登陆
# Authentication: LoginGraceTime 120 #PermitRootLogin without-password PermitRootLogin yes StrictModes yes
重新启动ssh服务
# service ssh restart
4、安装中文语言包
# apt-get install language-pack-zh-hans
5、配置静态IP
# vi /etc/network/interfaces
注释
#iface ens33 inet dhcp
追加
iface ens33 inet static
address 192.168.1.181
gateway 192.168.1.1
netmask 255.255.255.0
修改DNS
#vim /etc/resolv.conf nameserver 192.168.1.1
重启失效追加DNS
vi /etc/resolvconf/resolv.conf.d/base
nameserver 192.168.1.1 nameserver 8.8.8.8 nameserver 8.8.4.4
Google提供的免费DNS服务器的IP地址
主 8.8.8.8 和 备 8.8.4.4
重启网络
# /etc/init.d/networking restart
6、修改源
# cp /etc/apt/sources.list /etc/apt/sources.list.bak
# vim /etc/apt/sources.list
# apt-get update
阿里源
#deb包 deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse ##测试版源 deb http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse # 源码 deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse ##测试版源 deb-src http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse # Canonical 合作伙伴和附加 deb http://archive.canonical.com/ubuntu/ xenial partner deb http://extras.ubuntu.com/ubuntu/ xenial main
7、关闭防火墙、启用防火墙
# ufw disable
# ufw anable