新安装的ubuntu系统,需要做下简单的优化,使其符合常用习惯,优化过程的命令与centos大都不一致,撰文备份,以备所需:
1.获取ubuntu系统root权限
在终端输入sudo passwd root,按回车,然后系统会提示你输入普通用户的密码(终端输入的密码都是不显示的)。输入后,按回车,然后重复输入两次新的root密码即可激活root用户。
2.安装vim文本编辑器
输入命令:sudo apt-get install vim-gtk
3.允许root远程登陆
apt-get install openssh-server
修改/etc/ssh/sshd_config
注释PermitRootLogin prohibit-password
添加PermitRootLogin yes
reload一下sshd服务即可
4.使ubuntu系统可以ssh远程连接
需要修改/etc/ssh/ssh_config文件,去掉最后一行PermitRootLogin yes
5.关闭防火墙
ufw disable
6.更新apt-get源为阿里源
替换/etc/apt/sources.list文件中内容为:
deb-src http://archive.ubuntu.com/ubuntu xenial main restricted #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
deb http://mirrors.aliyun.com/ubuntu/ xenial multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse #Added by software-properties
deb http://archive.canonical.com/ubuntu xenial partner
deb-src http://archive.canonical.com/ubuntu xenial partner
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-security multiverse