본문 바로가기

programming/Linux

CentOS7 설치 후 기본 설정

1. yum update하기

[root@localhost ~]#yum -y update

 

2. 고정ip 설정하기

[root@localhost ~]#umtui

ipv4는 manual

ipv6는 ignore

 

disactivate -> activate

 

[root@localhost ~]#sysytemctl restart network

 

3. 패키지 설치

[root@localhost ~]#yum -y install epel-release rsync wget vim rdate psmisc net-tools lsof

 

4. Asia/Seoul로 시간대 세팅

[root@localhost ~]#timedatectl set-timezone Asia/Seoul

 

5. ssh 보안 설정

1) 설치

[root@localhost ~]#yum install openssh-server

 

2) 포트오픈 (CentOS7부터는 firewall)

[root@localhost ~]# firewall-cmd --zone=public --add-port=22/tcp -permanent
[root@localhost ~]# firewall-cmd --reload
[root@localhost ~]# firewall-cmd --zone=public --list-all

 

[root@localhost ~]# vi /etc/sshd/sshd_config
#port 22			// 주석 풀어주기

:wq!

 

[root@localhost ~]# service sshd start

[root@localhost ~]# ps -aef | grep sshd

[root@localhost ~]# ping 8.8.8.8

 

 

6. ftp 설정

1) vsftpd 패키지 설치

[root@localhost ~]# ps -ax | grep vsftpd
[root@localhost ~]# yum -y install vsftpd

 

2) ftp 서버 설정

[root@localhost ~]# vi /etc/vsftpd/vsftpd.conf

anonymous_enable=YES

chroot_list_enable=YES
chroot_list_file=/etc/vsftpd/chroot_list

아래 허용 리스트에 허용할 아이디 리스트 입력

 

3) 방화벽 설정

[root@localhost ~]# firewall-cmd --permanent --add-service=ftp
success
[root@localhost ~]# firewall-cmd --permanent --add-port=21/tcp
success
[root@localhost ~]# firewall-cmd --reload
success

 

4) SELINUX 해제

[root@localhost ~]# vi /etc/selinux/config

# This file controls the state of SELinux on the system. 
# SELINUX= can take one of these three values: 
# enforcing - SELinux security policy is enforced. 
# permissive - SELinux prints warnings instead of enforcing. 
# disabled - No SELinux policy is loaded. 
SELINUX=disabled 
# SELINUXTYPE= can take one of three values: 
# targeted - Targeted processes are protected, 
# minimum - Modification of targeted policy. Only selected processes are protected. 
# mls - Multi Level Security protection. SELINUXTYPE=targeted

enforcing을 disabled로 변경

 

 

5) 데몬 재시작

[root@localhost ~]# systemctl enable vsftpd 
[root@localhost ~]# systemctl restart vsftpd

 

참조 사이트

CentOS 7 기본설정 (tistory.com)

 

CentOS 7 기본설정

NIC rename on Centos7 # Centos 7 설치후 아래와 같이 실제 물리적인 인터페이스에 대하여 eno ... 등과 같이 사람이 eth0 과 같은 사람들이 # 인식하기 힘든 인터페이스 이름으로 변경 되어 있다. [root@localho

louie0.tistory.com

[리눅스/CentOS] CentOS 7 설치 후 초기 세팅 방법(2) : 네이버 블로그 (naver.com)

 

[리눅스/CentOS] CentOS 7 설치 후 초기 세팅 방법(2)

안녕하세요. 닷홈 입니다. 오늘은 저번 글에 이어 CentOS7 설치 후 초기 세팅에 대해 알아보겠습니다. ...

blog.naver.com

[CentOS 7] CentOS 7 FTP 설치 및 설정하기 (tistory.com)

 

[CentOS 7] CentOS 7 FTP 설치 및 설정하기

FTP 서버 구축 순서 1. vsftpd 패키지설치 2. 서버 설정 (conf 파일 및 허용리스트 작성) 3. 방화벽 설정 & selinux해제 4. 데몬재시작 5. 추가사항 6. 재시작 에러시 대처 1. vsftpd 패키지 설치 grep 명령어를..

holjjack.tistory.com