centos7安装后,一些小优化
1.设置静态ip
vim /etc/sysconfig/network-scripts/ifcfg-ens33

将BOOTPROTO=dhcp修改为BOOTPROTO=static ONBOOT=no修改为ONBOOT=yes 新增 IPADDR=192.168.80.129
PREFIX=24 #NETMASK=255.255.255.0
GATEWAY=192.168.80.2
DNS1=114.114.114.114
DNS2=8.8.8.8
之后重启网络服务
systemctl restart network
2.关闭NetworkManager
systemctl status NetworkManager systemctl stop NetworkManager systemctl disable NetworkManager
3.关闭selinux
vim /etc/selinux/config 将SELINUX=enforcing注释掉,并添加SELINUX=disabled,之后重启电脑生效
4.修改主机名
hostnamectl set-hostname centos2
5.修改yum源为阿里云
cd /etc/yum.repos.d wget http://mirrors.aliyun.com/repo/Centos-7.repo mv CentOS-Base.repo CentOS-Base.repo.bak mv Centos-7.repo CentOS-Base.repo yum clean all yum makecache yum update
6.设置环境变量
cd /etc/profile.d/ vim custom.sh export PS1="\[\e[35;1m\][\u@\h \w]\\$\[\e[m\] " alias sudo='sudo ' alias egrep='egrep --color=auto'
alias fgrep='fgrep --color=auto'
alias grep='grep --color=auto'
alias ls='ls --color=auto'
alias l.='ls -d .* --color=auto'
alias ll='ls -l --color=auto'
alias l='ls -laF' alias cp='cp -i'
alias mv='mv -i'
alias rm='rm -i' alias now='date +%Y%m%d%H%M%S' source custom.sh
7.ssh无密码登录
生成公钥私钥
ssh-keygen -t rsa
新建文件并添加主机公钥
touch authorized_keys #vim authorized_keys
8.修改最大文件打开数
先查看默认最大文件打开数
ulimit -n ulimit -a
修改配置文件
vim /etc/security/limits.conf
在最后添加
* soft nofile 65535 * hard nofile 65535
之后重启电脑生效

centos7安装后,一些小优化的更多相关文章
- VMware下CentOS7安装后,还原虚拟网络后,敲ifconfig不显示局域网ip解决方法
VMware下CentOS7安装后,还原虚拟网络后,敲ifconfig不显示局域网ip,没有出现eth0网卡,不能上网,SSH不能连接,输入ifconfig后如下图: 解决方法: 1.编辑网卡的配置文 ...
- centos7 最小化安装后的配置优化
echo #CENTOS7echo #1.最小化安装之后需要做的事echo 2.配置echo 2.1 安装网络yum install net-tools -y echo 2.2 更新机器名echo h ...
- CentOS7安装后配置MariaDB
安装后,优先推荐先对安全设置进行配置,键入命令 sudo mysql_secure_installation 键入当前密码,当前没有,直接回车,之后跟随提示会问几个问题:设置 root 密码? / 移 ...
- Centos7安装完成后一些小优化
1.修改ip地址.网关.主机名.DNS等 [root@localhost ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE=eth0 #网 ...
- MySQL安装后的初始优化
mysql数据库在安装之后,有一些内置的库(test库).用户(如root@localhost.localdomain)是不需要的,而且在Linux系统上,yum安装的mysql是默认无root密码的 ...
- centos7 安装后静态ip的配置
centos7 想到于centos6.5来说界面上看起来更加炫一点,但是在配置静态ip上来说是差不多的 首先看一下centos7的安装界面,相对来说简洁好看一些 先打开终端 可以看到centos7默认 ...
- CentOS7安装后连不上网络无法使用yum
更新日期:2018年5月31日 笔者今天在本地VMware中安装了CentOS7后,使用yum安装wget的时候发现不能下载,并有下图所示的提示: 于是,笔者就去问度娘,然后就找到了如下各种回复: 1 ...
- centos7系统安装后的基础优化
1.更改网卡信息 1.编辑网卡 # cd /etc/sysconfig/network-scripts/ # mv ifcfg-ens33 ifcfg-eth0 # mv ifcfg-ens37 if ...
- centos7 安装后,意外出现Please make your choice from above ['q' to quit | 'c' to continue | 'r' to refresh]
安装完成centos7后出现如下提示: Initial setup of CentOS Linux 7 (core) 1) [x] Creat user 2) [!] License informat ...
随机推荐
- [LeetCode] 151. Reverse Words in a String 翻转字符串中的单词
Given an input string, reverse the string word by word. For example,Given s = "the sky is blue& ...
- [LeetCode] 293. Flip Game 翻转游戏
You are playing the following Flip Game with your friend: Given a string that contains only these tw ...
- shell request failed on channel 0
今天普通用户ssh 登录提示shell request failed on channel 0 然后就退出了 幸亏root 用户没有被禁用,在root下 su - 普通 切换提示资源不足 解决方法 ...
- AutoResetEvent 学生考试,老师阅卷,学生等待考试结果
class Program { static void Main(string[] args) { )); t.Start(); Console.WriteLine("老师等待提交试卷&qu ...
- javascript高德地图实现点击marker消失marker
javascript高德地图实现点击marker消失marker <pre> var markers = []; var positions = [[120.17718, 30.21772 ...
- php_mvc实现步骤十
shop34-19-商品添加 功能:添加商品表单 Index.php?p=back&c=Goods&a=add Controller-Action: 新建商品控制器类 Applicat ...
- TCP粘包和拆包的定义,产生的原因以及解决方案
TCP粘包:指发送方发送的若干数据包在接收方接收时粘成一团,从接收缓冲区看,后一包数据的头紧接着前一包数据的尾 产生的原因: 1.发送方的原因:TCP默认使用Nagle算法,而Nagle算法主要做两件 ...
- Django之拾遗
一.设计模式 1.1 MVC 模型(M)是数据的表述,非真正数据,而是数据接口. 视图(V)是你看到的界面,是模型的表现层,此外还提供了收集用户输入的接口. 控制器(C)控制模型和视图之间的信息流动. ...
- struct,interface,method
struct类型,值传递的 声明 struct { name string age int } //几种声明使用方式: var P person // P现在就是person类型的变量了 P.name ...
- docekr安装mysql,redis,git和maven 脚本
编写脚本 images_install.sh #!/bin/bash # author:qiao # 安装脚本 # reids:3.2(自启) mysql:5.7(自启)或者JDK:1.8 tomca ...