一般系统安装好后,按照自己习惯定义
csharp;gutter:true;</p>
<h1>alias</h1>
<p>echo "alias cdyum='cd /etc/yum.repos.d/'" >> /root/.bashrc
echo "alias cdnet='cd /etc/sysconfig/network-scripts/'" >> /root/.bashrc
source /root/.bashrc</p>
<h1>set hosts</h1>
<h1>interFace=·ifconfig | awk -F: 'NR==1{print $1}'·</h1>
<h1>ipAddress=<code>ip add show $interFace |grep 'inet '|awk -F'[ /]+' '{print $3}'</code></h1>
<p>ipAddress=<code>hostname -I</code>
hostName=<code>hostname</code>
echo "$ipAddress $hostName" >> /etc/hosts
tail -1 /etc/hosts</p>
<h1>ssh dns</h1>
<p>grep UseDNS /etc/ssh/sshd_config
sed -i 's/#UseDNS yes/UseDNS no/' /etc/ssh/sshd_config
sed -i 's/#UseDNS no/UseDNS no/' /etc/ssh/sshd_config
grep UseDNS /etc/ssh/sshd_config</p>
<h1>firewall</h1>
<p>iptables -F
iptables -L -n
systemctl stop firewalld
systemctl disable firewalld</p>
<h1>selinux</h1>
<p>[ <code>getenforce</code> != "Disabled" ] && setenforce 0 &> /dev/null && sed -i s/"^SELINUX=.*$"/"SELINUX=disabled"/g /etc/selinux/config
getenforce
grep SELINUX= /etc/selinux/config</p>
<h1>set yum repo</h1>
<p>cat << EOF > /etc/yum.repos.d/rhel.repo
[rhel]
name=rhel
baseurl=file:///mnt
enabled=1
gpgcheck=0
EOF
mount /dev/cdrom /mnt
yum clean all
yum install vsftpd createrepo bash-completion vim net-tools lrzsz -y
systemctl start vsftpd;systemctl enable vsftpd
Original: https://www.cnblogs.com/reid21/p/10630212.html
Author: Reid21
Title: 系统初始化
原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/582844/
转载文章受原作者版权保护。转载请注明原作者出处!