시스템 관리 작업 - 미션
미션 1: php 계정 생성 및 php.st.kr 접속 설정
1. php 계정을 생성하고 php.st.kr로 접속 가능하도록 설정합니다.
adduser php su php cd ~ chmod 711 $HOME chmod 755 ~/public_html
Apache 설정
nano /etc/apache2/sites-available/hosting.conf ---------------------------------------------DocumentRoot /home/php/public_html ServerName php.st.kr ServerAdmin php@php.st.kr ErrorLog /home/php/public_html/logs/error.log CustomLog /home/php/public_html/logs/access.log combined ---------------------------------------------
로그 파일 생성
# log 디렉토리 안에 access.log와 error.log 파일 생성 root@mail:/home/php/public_html/logs# ls access.log error.log
Apache 서비스 재시작
systemctl restart apache2
미션 2: 관리자 PC에서 EditPlus를 이용해 php.st.kr 접속
관리자 PC에서 EditPlus를 사용하여 php.st.kr에 접속할 수 있도록 설정합니다.
미션 3: 외부 공격자(해커) 접근 시도
wp-scan을 사용한 공격 시도
wpscan --url word.st.kr -U user.txt -P passwd.txt
외부 연결 후 (NAT로 변경 후)
wpscan --url aps.or.kr -U user.txt -P passwd.txt
MySQL 설정 변경
nano /etc/mysql/mysql.conf.d/mysql.cnf bind-address = 127.0.0.1 bind-address = 0.0.0.0
SMB(Samba) 설정
새 그룹 및 사용자 추가
groupadd sambaGroup chgrp sambaGroup /backup usermod -G sambaGroup word smbpasswd -a word 123456 123456
Samba 설정 파일 수정
nano /etc/samba/smb.conf unix charset = UTF-8 [/backup] path = /backup guest ok = no read only = yes create mode = 0777 directory mode = 0777 valid users = @sambaGroup
Samba 테스트 및 서비스 재시작
testparm systemctl restart smbd systemctl status smbd