Linux 系统初始化脚本
2011-12-09 16:03
393 查看
Linux 系统初始化脚本
适用于批量部署linux 操作系统!
#update 20130305
cat sys-init.sh
结束
更多请:
linux 系统运维 37275208
vmware 虚拟化 166682360
适用于批量部署linux 操作系统!
#update 20130305
cat sys-init.sh
#!/bin/bash #linux system initialization #update 20130305 by dongnan # #关闭不需要的服务 chkconfig atd off chkconfig cups off chkconfig bluetooth off chkconfig hidd off chkconfig ip6tables off chkconfig auditd off chkconfig autofs off chkconfig avahi-daemon off chkconfig avahi-dnsconfd off chkconfig cpuspeed off chkconfig isdn off chkconfig nscd off chkconfig pcscd off chkconfig yum-updatesd off chkconfig acpid off chkconfig autofs off chkconfig firstboot off chkconfig mcstrans off chkconfig rpcgssd off chkconfig rpcidmapd off chkconfig setroubleshoot off chkconfig xfs off chkconfig xinetd off chkconfig messagebus off chkconfig gpm off chkconfig restorecond off chkconfig haldaemon off chkconfig sysstat off chkconfig readahead_early off chkconfig anacron off chkconfig iscsid off chkconfig iscsi off chkconfig lm_sensors off chkconfig mdmonitor off chkconfig ntpd off chkconfig smb off chkconfig rawdevices off chkconfig iptables off chkconfig netfs off chkconfig nfs off chkconfig nfslock off chkconfig portmap off chkconfig hplip off chkconfig nfs off chkconfig nfslock off chkconfig portmap off #打开需要的服务 chkconfig crond on chkconfig irqbalance on chkconfig kudzu on chkconfig microcode_ctl on chkconfig messagebus on chkconfig network on chkconfig sshd on chkconfig syslog on chkconfig --list | grep '3:on' #关闭selinux sed -ir 's/SELINUX=.*/SELINUX=disabled/g' /etc/selinux/config #设定最大文件句柄数量 echo -e '* soft nofile 65536 * hard nofile 65536' >> /etc/security/limits.conf #同步时间 echo -e "#ntpdate \n/usr/sbin/ntpdate time-nw.nist.gov" >> /etc/rc.local #tcp/ip 优化 echo -en '#begin net.ipv4.tcp_tw_reuse = 1 net.ipv4.tcp_fin_timeout = 30 net.ipv4.ip_local_port_range = 10240 65000 net.ipv4.tcp_max_syn_backlog = 16384 net.ipv4.tcp_synack_retries = 3 net.ipv4.tcp_syncookies = 1\n' >> /etc/sysctl.conf sysctl -p #.vimrc 文件 cat > ~/.vimrc << EOF set nobackup set number set cindent set autoindent set shiftwidth=2 set tabstop=2 set softtabstop=2 set expandtab set ruler syntax on EOF #.bash_profile echo -en '# .bash_profile # Get the aliases and functions if [ -f ~/.bashrc ]; then . ~/.bashrc fi # User specific environment and startup programs PATH=$PATH:$HOME/bin export PATH HISTTIMEFORMAT="$(whoami) [%Y-%m-%d %H:%M:%S] " && export HISTTIMEFORMAT #after add ip=`/sbin/ifconfig eth0 | grep Bcast | sed -e "s/^.* addr:\\(.*\\) Bcast.*$/\1/"` || ip=`/sbin/ifconfig eth1 | grep Bcast | sed -e "s/^.* addr:\\(.*\\) Bcast.*$/\1/"` PS1="\[\e[32;1m\]$ip\[\e[0m\][\W]\$ " && export PS1 #export HISTIGNORE="&:history:ls:ls *:ps:ps -A:df:df *:du:du *:[bf]g:exit" #unset USERNAME echo "[LOAD]";cat /proc/loadavg;echo "[DISK]";df -Th locale | sed -r 's/zh_CN/en_US/g' > .lang source ~/.lang \n' > ~/.bash_profile
结束
更多请:
linux 系统运维 37275208
vmware 虚拟化 166682360
相关文章推荐
- 初始化linux系统脚本
- LINUX 系统初始化脚本
- shell 初始化linux系统脚本
- linux 系统初始化超级脚本
- linux 系统初始化脚本
- 刚学习时自己写的一个linux系统初始化脚本
- Linux系统初始化脚本
- linux安装redis并使用其提供的初始化启动脚本加入到系统服务中
- Linux系统初始化脚本
- 【linux】系统初始化的shell脚本
- LINUX 系统初始化脚本
- linux 系统初始化超级脚本
- linux系统初始化SHELL脚本
- linux系统初始化——启动脚本是如何工作的
- 刚学习时自己写的一个linux系统初始化脚本
- 生产环境的系统初始化脚本【Linux运维之道之脚本案例】
- linux系统初始化脚本
- Linux 基本系统初始化脚本第一版 推荐
- linux系统初始化脚本
- linux安装redis并使用其提供的初始化启动脚本加入到系统服务中