Centos7 一键自定义初始化

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

每次装一个全新的centos,都要配置很多相同的基础配置,索性写个脚本,一键自定义初始化

每次把这脚本传进去前,需要先按照一个传文件的软件--lrzsz

yum install lrzsz -y

安装成功后,导入脚本,bash一下,就可以完成初始化了

下面是脚本全部内容,才疏学浅,还请大佬们多多指点

#!/bin/bash

# To fast configuring centos7 related base configuration


# Close selinux startup startup
sed -i 's#SELINUX=enable#SELINUX=disabled#' /etc/selinux/config

# Close firewalld startup startup
systemctl disable firewalld

# Close firewalld
systemctl stop firewalld

# Set c as the shortcut key for clear
sed -i "\$a alias c='clear'" ~/.bashrc

# Change your host name
read -p 'Please input the hostname you want: ' hostname
hostnamectl set-hostname $hostname

# Download epel-release、net-tools、vim、lsof、wget
yum install epel-release net-tools vim lsof wget -y

# Reboot system
reboot

猜你喜欢

转载自blog.csdn.net/qq_24601199/article/details/89317112
今日推荐