【微服务架构 - 01 - Linux】02 Linux 基本配置

修改数据源

由于国内的网络环境问题,我们需要将 Ubutu 的数据源改为国内数据源。

查看系统版本

lsb_release -a

输出结果为:

No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 16.04 LTS
Release:	16.04
Codename:	xenial

注意:Codename 为 xenial,该名称为我们 Ubuntu 系统的名称,修改数据源需要用到该名称。

编辑数据源

vi  /etc/apt/sources.list

删除全部内容并修改为

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

更新数据源

apt-get update

使用 Root 用户

在实际生产操作中,我们基本上都是使用超级管理员账户操作 Linux 系统,也就是 Root 用户,Linux 系统默认是关闭 Root 账户的,我们需要为 Root 用户设置一个初始密码以方便我们使用。

设置 Root 账户密码

sudo passwd root

切换到 Root

su

设置允许远程登录 Root

vi /etc/ssh/sshd_config

# Authentication:
LoginGraceTime 120
#PermitRootLogin without-password     //注释此行
PermitRootLogin yes                             //加入此行
StrictModes yes

重启服务
service ssh restart

猜你喜欢

转载自blog.csdn.net/qq_37581282/article/details/86486913