基本操作一:更改主机名

centos7有一个新的修改主机名的命令hostnamectl
# hostnamectl set-hostname --static benjamin
# vim /etc/hosts    --最后加上你的IP与主机名的绑定
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
:: localhost localhost.localdomain localhost6 localhost6.localdomain6
10.0.0.8 benjamin


基本操作二:关闭iptables
# systemctl status firewalld.service    --查看firewalld服务的状态,active是启动状态,inactive是关闭状态
# systemctl stop firewalld.service --关闭此服务
# systemctl list-unit-files |grep firewalld --查看firewalld是否开机自动启动
firewalld.service enabled # systemctl disable firewalld.service --类似以前的chkconfig xxx off
# systemctl list-unit-files |grep firewalld
firewalld.service disabled


基本操作三:关闭selinux
# sed -i 7s/enforcing/disabled/  /etc/selinux/config    --改完后,在后面重启系统生效


基本操作四:网络配置
# systemctl stop NetworkManager        --停止服务
# systemctl status NetworkManager --查看状态,确认为关闭了
# systemctl disable NetworkManager --设置为开机不自动启动
# vim /etc/sysconfig/network-scripts/ifcfg-eth0 --网卡名如果不一样,找到对应的文件就行
BOOTPROTO="static"
NAME="eth0"
DEVICE="eth0"
ONBOOT="yes"
IPADDR=10.0.0.8
NETMASK=255.255.255.0
GATEWAY=10.0.0.2
DNS1=114.114.114.114
# /etc/init.d/network restart --network服务这里默认还是可以使用原来的管理方法
# chkconfig network on


基本操作五:yum配置
#配置本地yum源
# rm /etc/yum.repos.d/* -rf --这里我删除了它所有的默认的配置(因为这些默认配置要连公网的源,速度太慢)
# vim /etc/yum.repos.d/local.repo --然后自建了本地yum源配置文件
[local]
name=local
baseurl=file:///yum
enabled=1
gpgcheck=0

配置可选163的centos源
163centos源(其实就是centos官方的yum,使用163的国内速度更快)
配置方法两种
a)直接公网连接网易163,优点:速度快,软件包会定期更新
# cd /etc/yum.repos.d/
# wget http://mirrors.163.com/.help/CentOS7-Base-163.repo

b)自己编写
# vim /etc/yum.repos.d/cento163.repo
[centos163]
name=centos163
baseurl=http://mirrors.163.com/centos/7.4.1708/os/x86_64/ #这个会根据版本迭代适时变化
enabled=
gpgcheck=

配置可选epel源
配置方法两种
a)直接公网连接epel,优点:速度快,软件包会定期更新
# wget http://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/e/epel-release-7-11.noarch.rpm   --此版本信息会随时间推移而变化
# rpm -ivh epel-release--.noarch.rpm
b)自己编写
# vim /etc/yum.repos.d/epel.repo
[epel]
name=epel
baseurl=http://dl.fedoraproject.org/pub/epel/7/x86_64
enabled=
gpgcheck=

配置完上面三个yum后
# yum clean all
# yum makecache fast

基本操作六:配置国内pip源
国外网站的pip源速度慢且不稳定,经常出现下载到一半就断开了很是蛋疼!
# yum install python-pip
# vim ~/.pip/pip.conf

  [global]

  index-url = http://pypi.douban.com/simple

  trusted-host = pypi.douban.com


安装完后,需要右上角把用户注销重登录
左上角applications--system tools -- settions -- Region & Language -- +或-你的输入法就可以了
加完之后,使用super+space键进行切换

基本操作七:时间同步
# yum install ntp  ntpdate    --安装ntp时间同步相关软件包
# vim /etc/ntp.conf --确认配置文件里有下列的时间同步源
server .rhel.pool.ntp.org iburst
server .rhel.pool.ntp.org iburst
server .rhel.pool.ntp.org iburst
server .rhel.pool.ntp.org iburst
# systemctl enable ntpd --设置开机自动启动ntpd
# systemctl start ntpd --立即启动ntpd服务
# date --确认时间与现在时间一致
# ntpdate .rhel.pool.ntp.org --如果还没有同步成功,你可以用此命令手动同步一下
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime #更改时区为上海


另外一个时间服务器的搭建方法
# yum install xinetd -y
# vim /etc/xinet.d/time-dgram
disable = no (--yes改为no)
# vim /etc/xinetd.d/time-stream
disable = no (--yes改为no)
# systemctl restart xinetd
# systemctl status xinetd
# systemctl enable xinetd

客户端同步时间的用法
# rdate -s 时间服务器的ip


基本操作八:
有些命令的参数可以自动补全,如果不能补全,则安装下面的命令(可能需要注销一下)
# yum install bash-completion

基本操作九:vnc的配置
# vncpasswd         --设定vcn连接的密码
Password:
Verify:
# x0vncserver --PasswordFile=/root/.vnc/passwd --AlwaysShared=on --AcceptKeyEvents=off AcceptPointerEvents=off &> /dev/null &

基本操作十:桌面锁屏
左上角applications--system tools -- settions -- Privacy  设置是否自动锁屏

手动锁屏
super+l 

基本操作十一:图形界面快捷键修改
左上角applications--system tools -- settions -- Keyboard -- Shortcuts   去修改自己习惯的快捷键

基本操作十二:设置默认启动级别为图形模式(相当于以前的5级别)
# systemctl get-default            --查看当前的运行模式
# systemctl set-default graphical.target --设置图形模式为默认模式
# systemctl set-default multi-user.target --设置命令行模式为默认模式
 

centos7刚安装需要的一些基础优化的更多相关文章

  1. CentOS7下安装Nexus私服及基础配置

    环境准备 VMware上安装CentOS7 XShell/Xftp NexusOSS-3.10 jdk1.8 安装 使用root用户登录,将安装包均放置在/usr/local文件夹下 使用Xshell ...

  2. CentOS6安装后的常见基础优化

    1.SSH优化 编辑/etc/ssh/sshd_config配置文件 //全部都应该设置为no /etc/ssh/sshd_config //服务端配置文件 /etc/ssh/ssh_config / ...

  3. CentOS7.5基础优化与常用配置

    目录 最小化全新安装CentOS7基础优化 配置yum源 安装常用软件 关闭防火墙 关闭SELinux 优化ulimit 历史命令记录改为1万条 把命令提示符改为绿色 添加vim配置文件 添加一个普通 ...

  4. Centos7安装完成后一些小优化

    1.修改ip地址.网关.主机名.DNS等 [root@localhost ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE=eth0 #网 ...

  5. 基础知识——CentOS7操作系统的安装图文教程

    学习了很久的Linux操作系统,也看了不少的资料,对于操作系统的安装,相对来说都在不断的改进,安装的难度也在不断的降低,操作步骤也变得非常的简单了. 有很多CentOS系统的安装教程,但是比较不全面或 ...

  6. linux系统的基础优化

    目录 前言 网络优化 在虚拟软件中配置虚拟局域网 接着可以配置自己windows主机的网络连接配置 在虚拟软件中虚拟机添加网卡 虚拟机中的系统基础优化 前言 在自己做linux的相关服务实验时,是没有 ...

  7. 学习笔记:(转)Centos7.6安装Oracle11gR2

    目录 原文链接:https://www.cnblogs.com/qianjingchen/articles/10442445.html Windows下安装Oracle比较容易,参考博客:https: ...

  8. 运维 07 Linux系统基础优化及常用命令

    Linux系统基础优化及常用命令   Linux基础系统优化 引言没有,只有一张图. Linux的网络功能相当强悍,一时之间我们无法了解所有的网络命令,在配置服务器基础环境时,先了解下网络参数设定命令 ...

  9. CentOS7下安装Gitlab社区版【安装步骤、IP改域名、修改端口】

    这两天一直在给公司的服务器配置Gitlab(10.5.4).过程很是痛苦,所以把过程记录一下. 1.安装CentOS7 从官网上下载了最新版CentOS-7-x86_64-DVD-1708.iso.用 ...

随机推荐

  1. 深入理解Angular2变化监测和ngZone

    转载自GitHub JTangming : https://github.com/JTangming/tm/issues/4 Angular应用程序通过组件实例和模板之间进行数据交互,也就是将组件的数 ...

  2. Avril Lavigne : Everybody Hurts (Ver3)

    http://www.guitartabsexplorer.com/ http://www.guitartabsexplorer.com/lavigne-avril-Tabs/everybody-hu ...

  3. LDAP操作的两种方案

    最近由于项目需要研究了一下LDAP相关知识,感觉对没接触过的人来说还是有点坑的,所以记录下来给大家分享. 由于是第一次接触,就在网上搜了一些相关的文章,照着示例代码测试,却怎么也连不上LDAP服务器, ...

  4. 剑指Offer - 九度1513 - 二进制中1的个数

    剑指Offer - 九度1513 - 二进制中1的个数2013-11-29 23:35 题目描述: 输入一个整数,输出该数二进制表示中1的个数.其中负数用补码表示. 输入: 输入可能包含多个测试样例. ...

  5. 恢复误删除表黑科技之relay log大法

      Preface       In my previous blogs,I've demonstrated several mothods of how to rescue a dropped ta ...

  6. 基于Xtrabackup备份集来恢复某个误删除的表(drop)

      Preface       Yesterday,I've demonstratated how to rescue a droped and a truncated table based on ...

  7. Velocity 语法详解

    Velocity是基于Java的模板引擎,它允许页面设计者引用Java中定义的方法.页面设计者和Java开发者能够同时使用MVC的模式开发网站,这样网页设计者能够把精力放在页面的设计上,程序员也可以把 ...

  8. Oracle 学习----游标(使用带参光标cursor)

    --表参照无参光标页信息 --注意:红色就是参数 declare cursor tt(pkeycode temp.keycode%type) is select name,sal from temp ...

  9. CodeSimth - .Net Framework Data Provider 可能没有安装。解决方法[转载 ]

    原文:http://www.cnblogs.com/chenrui7/p/3592082.html 今天想使用CodeSimth生成一个sqlite数据库的模板.当添加添加数据库的时候发现: .Net ...

  10. TOJ 3046: 招商银行网络系统

    3046: 招商银行网络系统  Time Limit(Common/Java):1000MS/3000MS     Memory Limit:65536KByteTotal Submit: 12   ...