CentOS 7 설치 후 할 일
1. minimal 로 설치
4 min readJan 28, 2016
- 개발툴
- 호환성 라이브러리
2. 호스트 네임 설정
# hostnamectl set-hostname 호스트이름
3. 네트워크 인터페이스 이름 및 ipv6 disable
“GRUB_CMDLINE_LINUX” 에 내용 추가
# vi /etc/default/grubGRUB_CMDLINE_LINUX=”rhgb quiet net.ifnames=0 biosdevname=0 ipv6.disable=1"# grub2-mkconfig -o /boot/grub2/grub.cfg
4. net-tools 설치
centos 7 버전부터 ifconfig, netstat 등 명령어들을 사용하려면
net-tools 패키지를 설치해야 함.
# yum install net-tools
5. open-vm-tools 설치해야
리눅스를 위한 VMware Tool의 오픈소스 버전. 각 커뮤니티에서 업데이트 및 지원을 얻을 수 있다.
# yum install open-vm-tools
이쯤에서 리부팅 한 번.. open-vm-tools 도 설치했으니 host 시간과 동기화도 잘 될 것이다.
6. 네트워크 설정
nmcli 를 이용할 수도 있지만.. 이왕이면 편하게.. nmtui 를 사용.
“ens” 로 시작하는 것은 지우고 새로 생긴 NIC 를 편집. 맥 주소 부분에 (ethX) 로 네트워크 인터페이스 이름이 표시된다. 서버에서 사용할 네트워크에 맞게 설정하면 된다.
기본 게이트웨이를 2개 넣어도 에러가 발생하지 않으니 주의.
# nmtui# systemctl restart network# systemctl restart NetworkManager
7. sshd_config
# vi /etc/ssh/sshd_configPort 22AddressFamily inetLoginGraceTime 2mPermitRootLogin noPermitEmptyPasswords noX11Forwarding noUseDNS no
8. SELinux
enforcing 을 disabled 로 변경
# vi /etc/sysconfig/selinuxSELINUX=disabled
9. iptables
firewalld 에 의해서 iptables 룰이 생성됨.
고로 firewalld 를 비활성화하고 중지
# systemctl stop firewalld# systemctl mask firewalld# systemctl disable firewalld
disable — 부팅 시작 시 비활성화
mask — 서비스 제거
iptables 와 관련된 패키시 설치
# yum install iptables-services# systemctl enable iptables# systemctl start iptables# iptables --flush# iptables-save > /etc/sysconfig/iptables
9. NTP
시간 동기화를 위해 ntpd 설치 및 timedatectl 명령으로 확인
# yum install ntpd# timedatectlLocal time: Sat 2016–01–30 13:03:25 KSTUniversal time: Sat 2016–01–30 04:03:25 UTCRTC time: Sat 2016–01–30 13:03:25Time zone: Asia/Seoul (KST, +0900)NTP enabled: n/aNTP synchronized: noRTC in local TZ: noDST active: n/a# systemctl start ntpd# systemctl enable ntpd# timedatectl Local time: Sat 2016–01–30 13:07:24 KSTUniversal time: Sat 2016–01–30 04:07:24 UTCRTC time: Sat 2016–01–30 04:07:24Time zone: Asia/Seoul (KST, +0900)NTP enabled: yesNTP synchronized: yesRTC in local TZ: noDST active: n/a
추가로 타임존 설정은
# timedatectl list-timezones# timedatectl set-timezone Asia/Seoul
설정가능한 타임존 목록을 확인할 수 있고 set-timezone 명령으로 타임존을 설정하면 된다.
10. 업데이트
# yum update
마지막으로 리부팅…
11. epel
추가로 설치할 것들이 있다면..
# yum install epel-release