본문 바로가기

Linux

centos 7 초기 설정

#!/bin/sh

 

# 기본 패키지 설치

yum install -y rdate wget net-tools sysstat psmisc vim 


# timezone 변경
ln -snf /usr/share/zoneinfo/Asia/Seoul /etc/localtime  

rdate -s time.bora.net

 

# rdate cron
echo "55 * * * * root rdate -s time.bora.net" >> /etc/crontab


## openfile limit
echo "fs.file-max = 2097152" >> /etc/sysctl.conf 
echo "* soft nproc 65535" >> /etc/security/limits.conf 
echo "* hard nproc 65535" >> /etc/security/limits.conf 
echo "* soft nofile 65535" >> /etc/security/limits.conf 
echo "* hard nofile 65535" >> /etc/security/limits.conf 

# rc-local enable
chmod +x /etc/rc.d/rc.local
echo "
[Install]
WantedBy=multi-user.target" >> /usr/lib/systemd/system/rc-local.service
systemctl enable rc-local
echo "rdate -s time.bora.net" >> /etc/rc.local 

# alias vi=vim
echo "alias vi=vim" >> /root/.bashrc

# sftp log
sed -i "s/sftp-server/sftp-server -f local2 -l INFO /g" /etc/ssh/sshd_config
echo "# sftp log
local2.*                         /var/log/sftp.log" >> /etc/rsyslog.conf

# sftp log rotate
sed -i '1i/var/log/sftp.log' /etc/logrotate.d/syslog 

# service change
systemctl disable NetworkManager
systemctl enable network
systemctl disable firewalld
systemctl disable chronyd
systemctl enable vsftpd
systemctl disable rpcbind

# selinux disable
sed -i "s/SELINUX=enforcing/SELINUX=disabled/g" /etc/selinux/config 

'Linux' 카테고리의 다른 글

centos 7 mail command 활성화  (0) 2021.12.06