Ubuntu 16.x 装机参考

系统镜像可到:https://mirrors.aliyun.com/ubuntu-releases/下载

#更改限制
vi /etc/security/limits.conf
root soft nofile 65535
root hard nofile 65535
* soft nofile 65535
* hard nofile 65535

#解锁root
sudo passwd -u root
#为root设置密码
sudo passwd root

#切换到root
su root

为了避免麻烦,先关闭防火墙:

#查看启动了哪些服务
systemctl list-unit-files | grep enabled
systemctl stop ufw.service
systemctl disable ufw.service

默认没有安装openssh-server(Ubuntu 16.04默认安装时需要选中,否则需要自己安装)

apt install openssh-server

systemctl start sshd.service
systemctl enable sshd.service

默认安装的openssh-server是禁止root链接的,它的逻辑是先以一个普通用户登录,如果需要切换,再用su来进行。如果麻烦可以修改:

vi /etc/ssh/sshd_config

PermitRootLogin prohibit-password	#改为yes(prohibit-password禁止密码,就是使用公钥还是可以的)
PermitEmptyPasswords yes		#是否允许空密码,默认是no

#重启服务
systemctl restart sshd.service

更换软件源头,参考:http://wiki.ubuntu.org.cn/%E6%A8%A1%E6%9D%BF:16.04source

deb http://cn.archive.ubuntu.com/ubuntu/ xenial main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ xenial-security main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ xenial-updates main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse
##测试版源
deb http://cn.archive.ubuntu.com/ubuntu/ xenial-proposed main restricted universe multiverse
# 源码
deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial-security main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial-updates main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse
##测试版源
deb-src http://cn.archive.ubuntu.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

这里的http://cn.archive.ubuntu.com/ubuntu/是阿里云资源,可以替换为http://mirrors.163.com/ubuntu/

安装桌面

apt update
apt upgrade

apt-get install --no-install-recommends ubuntu-desktop

add-apt-repository ppa:embrosyn/cinnamon
apt install cinnamon