Linux 篇 | Ubutu1804系统的基本配置
2019-06-19 22:16
1731 查看
Ubutu1804系统的基本配置
安装好Ubuntu系统后,可使用下面的配置优化系统
1.修改root用户的密码
sudo passwd root 输入密码 再次输入密码
2.修改配置,使root用户可以远程登录和开机可以使用root登录
sudo sed -i 's@mesg n || true@tty -s && mesg n || true@' /root/.profile sudo sed -i 's@mesg n || true@tty -s && mesg n || true@' /root/.profile 验证: 查看/root/.profile文件是下面的样子就行 root@ubuntu1804:~# cat /root/.profile # ~/.profile: executed by Bourne-compatible login shells. if [ "$BASH" ]; then if [ -f ~/.bashrc ]; then . ~/.bashrc fi fi tty -s tty -s mesg n || true root@ubuntu1804:~#
以上配置生效,需重启系统
3.修改Ubuntu的apt源
1.打开阿里云的Ubuntu源
https://opsx.alibaba.com/mirror
2.找到Ubuntu那一行,点击后面的“帮助”
3.根据上面的提示,打开“/etc/apt/sources.list”文件
- 把文件里默认的配置都清除
vi /etc/apt/sources.list
4.选择Ubuntu的版本,然后复制apt源的配置,如ubuntu 18.04(bionic) 配置如下:
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
5.更新apt源
apt-get update
6.更新apt源后,就可以用apt-get安装软件了
示例:安装haproxy和keepalived软件 apt-get install haproxy keepalived 输入“y”,确认安装
4.修改主机名
1.修改主机名 vi /etc/hostname 主机名 2.使主机名生效 reboot
5.修改默认ubuntu的网卡名称为“eth”格式
1.修改配置文件 vi /etc/default/grub 2.在GRUB_CMDLINE_LINUX添加内容 GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0" 3.生效新的grub.cfg文件 grub-mkconfig -o /boot/grub/grub.cfg 4.修改网卡配置文件的名称 把原来的"ensxx" 改为 “ethxx” 5.重启系统生效
相关文章推荐
- linux系统基本配置
- Linux系统网络基本配置
- Linux系统基本网络配置之ifconfig命令
- Linux系统下Git的基本配置和使用示例
- Linux基本操作系列(二):在CentOS 6.8系统上安装Tomcat并配置自动启动
- Linux学习记录_系统安装后的基本配置
- Linux系统基本网络配置
- Linux基本操作系列(二):在CentOS 6.8系统上安装Tomcat并配置自动启动
- linux系统中配置informix ISM 备份到磁盘基本配置
- Linux系统中Apache(阿帕奇)的基本配置信息
- Linux基本操作系列(二):在CentOS 6.8系统上安装Tomcat并配置自动启动
- CentOS 5.2,Linux 2.6+ 内核 ,Apache+MySQL+PHP 安装及基本配置过程记录 && 将apache安装为系统服务
- 安装完成ubuntu系统后的基本的相关配置---Linux总结笔记
- 第1天:Linux操作系统常用基本知识及linux系统下java环境配置
- Linux系统下iptables基本配置方法
- Linux基本操作系列(二):在CentOS 6.8系统上安装Tomcat并配置自动启动
- Linux基本操作系列(二):在CentOS 6.8系统上安装Tomcat并配置自动启动
- Linux基本操作系列(二):在CentOS 6.8系统上安装Tomcat并配置自动启动
- Linux基本操作系列(二):在CentOS 6.8系统上安装Tomcat并配置自动启动
- Linux系统下iptables基本配置方法