2.6.3 centos7配置系统

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/wrzfeijianshen/article/details/82820082

2.6.3 配置系统

它会自动安装vmtools的

centos启动sudo方法

CentOS默认不启用sudo,且可以直接用超级管理员身份登录服务器。ubuntu这方面做得比较好,为了安全,减小误操作带来的损失,还是推荐启用sudo。
添加sudo用户:
执行visudo命令,找到: root ALL=(ALL) ALL
在下面增加: fjs ALL=(ALL) ALL

一般来说到此就可以了,刚安装完系统,最好重启一下
/*备用
2、禁止root用户登录
编辑/etc/ssh/sshd_config
将 PermitRootLogin yes改为 PermitRootLogin no
3、重启sshd: service sshd reload
*/

配置网络



换源

1.备份
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
2.下载新的CentOS-Base.repo 到/etc/yum.repos.d/

CentOS 5

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo

CentOS 6

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo

CentOS 7

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

3.运行yum makecache生成缓存
yum clean all
yum makecache

wget -P /etc/yum.repos.d/ http://mirrors.aliyun.com/repo/epel-7.repo  

更新系统

sudo yum -y update && yum -y upgrade
设置屏幕分辨率和关闭防火墙


// 不建议直接关闭防火墙:直接关闭防火墙
systemctl stop firewalld.service #停止firewall
systemctl disable firewalld.service #禁止firewall开机启动
systemctl status firewalld.service #再次查看防火墙状态,发现已关闭

安装软件 非必须,但是一般都用得上,这里我就不安装了,用到时再安装。
yum install vim gcc gcc-c++ openssh-server vsftpd lftp tree lrzsz binutils compat-libstdc+±33 elfutils-libelf elfutils-libelf-devel elfutils-libelf-devel-static glibc glibc-common glibc-devel glibc-headers glibc-static kernel-headers pdksh libaio-devel libaio libgcc libgomp libstdc++ libstdc+±devel make sysstat numactl-devel unixODBC unixODBC-devel
关机

开机快照

猜你喜欢

转载自blog.csdn.net/wrzfeijianshen/article/details/82820082