본문 바로가기

ETC/자격증

[리눅스마스터]제1502회 리눅스마스터 1급 2차 시험 작업식 풀이 1

반응형

11. 다음은 웹서버의 설정관련 파일 중 일부분이다. 다음 조건에 맞게 ( 괄호 ) 안에 알맞은 내용을 적으시오.(9점)

Listen 80
( ① ) www.ihd.or.kr
( ② ) “/usr/local/apache”
( ③ ) “/www”

<조 건>
- 웹서버의 도메인은 www.ihd.or.kr 이다.
- 웹서버의 설치 디렉터리는 /usr/local/apache 이다.
- 서버의 인덱스 페이지가 위치하는 곳은 /www 이다.

 

/etc/httpd/conf/httpd.conf : 웹 서버 환경설정 파일 위치

 

[root@server1 ~]# find / -name httpd.conf
/etc/httpd/conf/httpd.conf
/usr/lib/tmpfiles.d/httpd.conf
/usr/local/src/httpd-2.4.12/docs/conf/httpd.conf
/usr/local/apache/conf/original/httpd.conf
/usr/local/apache/conf/httpd.conf

 

[root@server1 ~]# vi /etc/httpd/conf/httpd.conf
#
# ServerName gives the name and port that the server uses to identify itself.
# This can often be determined automatically, but we recommend you specify
# it explicitly to prevent problems during startup.
#
# If your host doesn't have a registered DNS name, enter its IP address here.
#
#ServerName www.example.com:80
# ServerRoot: The top of the directory tree under which the server's
# configuration, error, and log files are kept.
#
# Do not add a slash at the end of the directory path.  If you point
# ServerRoot at a non-local disk, be sure to specify a local disk on the
# Mutex directive, if file-based mutexes are used.  If you wish to share the
# same ServerRoot for multiple httpd daemons, you will need to change at
# least PidFile.
#
ServerRoot "/etc/httpd"
#
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "/var/www/html"

 

- ServerName : 웹 서버의 도메인 지정

- ServerRoot : 웹 서버의 설치 디렉터리

- DocumentRoot : 서버의 인덱스 페이지가 위치하는 곳

 

① ServerName

② ServerRoot

③ DocumentRoot

 

12. 다음은 NFS 서버의 설정파일이다. 다음 조건에 맞게 ( 괄호 ) 안에 알맞은 내용을 적으시오.(9점)

/etc/exports
( ① ) 192.168.10.10( (②), (③) )

<조 건>
- nfs 공유 디렉터리는 /data/nfs 이다.
- 공유된 자원을 읽기/쓰기로 마운트 한다.
- 클라이언트에서 루트를 서버상에 nobody 사용자로 매핑 한다.

 

/etc/exports : NFS 서버 환경 설정 파일

 

[root@server1 ~]# find / -name exports
/proc/fs/nfs/exports
/proc/fs/nfsd/exports
/etc/exports
/usr/lib/python2.7/site-packages/tuned/exports

 

[root@server1 ~]# vi /etc/exports

 

<주요 옵션>

- ro : 읽기 전용
- rw : 읽기 쓰기 허용
- root_squash : 클라이언트가 root 권한 획득 불허, 클라이언트의 root를 nobody로 맵핑.
- no_root_squash : 클라이언트가 root 권한 획득 가능, 클라이언트의 root와 서버의 root를 일치.
- all_squash : 모든 사용자를 nobody로 매핑
- no_all_squash : 서버의 사용자와 클라이언트의 사용자를 일치.

 

① /data/nfs

② rw

③ root_sqaush

 

13. 다음은 VSFTPd 서버의 설정파일이다. 다음 조건에 맞게 ( 괄호 ) 안에 알맞은 내용을 적으시오.(12점)

vsftpd.conf
( ① ) = 21
( ② ) = 022
ftp_data_port = ( ③ )

<조 건>
- vsftp데몬이 외부 접속 요청에 통신할 포트는 21번 이다.
- 파일이 생성될 때 파일 퍼미션에 적용될 값을 지정한다.
- ftp 데이터 전송에 사용할 포트는 20번 이다.

 

/etc/vsftpd/vsftpd.conf : vsftpd 서버의 환경 설정 파일

 

[root@server1 ~]# find / -name vsftpd.conf
/etc/vsftpd/vsftpd.conf
/usr/share/doc/vsftpd-3.0.2/EXAMPLE/INTERNET_SITE/vsftpd.conf
/usr/share/doc/vsftpd-3.0.2/EXAMPLE/INTERNET_SITE_NOINETD/vsftpd.conf
/usr/share/doc/vsftpd-3.0.2/EXAMPLE/VIRTUAL_USERS/vsftpd.conf

 

[root@server1 ~]# vi /etc/vsftpd/vsftpd.conf
# Example config file /etc/vsftpd/vsftpd.conf
#
# The default compiled in settings are fairly paranoid. This sample file
# loosens things up a bit, to make the ftp daemon more usable.
# Please see vsftpd.conf.5 for all compiled in defaults.
#
# READ THIS: This example file is NOT an exhaustive list of vsftpd options.
# Please read the vsftpd.conf.5 manual page to get a full idea of vsftpd's
# capabilities.
#
# Allow anonymous FTP? (Beware - allowed by default if you comment this out).
anonymous_enable=YES
#
# Uncomment this to allow local users to log in.
# When SELinux is enforcing check for SE bool ftp_home_dir
local_enable=YES
#
# Uncomment this to enable any form of FTP write command.
write_enable=YES
#
# Default umask for local users is 077. You may wish to change this to 022,
# if your users expect that (022 is used by most other ftpd's)
local_umask=022
#
# Uncomment this to allow the anonymous FTP user to upload files. This only
# has an effect if the above global write enable is activated. Also, you will
# obviously need to create a directory writable by the FTP user.
# When SELinux is enforcing check for SE bool allow_ftpd_anon_write, allow_ftpd_full_access
#anon_upload_enable=YES
#
# Uncomment this if you want the anonymous FTP user to be able to create
# new directories.
#anon_mkdir_write_enable=YES
#
# Activate directory messages - messages given to remote users when they
# go into a certain directory.
dirmessage_enable=YES
#
# Activate logging of uploads/downloads.
xferlog_enable=YES
#
# Make sure PORT transfer connections originate from port 20 (ftp-data).
connect_from_port_20=YES
#
# If you want, you can arrange for uploaded anonymous files to be owned by
# a different user. Note! Using "root" for uploaded files is not
# recommended!
#chown_uploads=YES
#chown_username=whoever
#
# You may override where the log file goes if you like. The default is shown
# below.
#xferlog_file=/var/log/xferlog
#
# If you want, you can have your log file in standard ftpd xferlog format.
# Note that the default log file location is /var/log/xferlog in this case.
xferlog_std_format=YES
#

 

<중요옵션>

anonymous_enable=YES  : 익명 사용자의 접속을 가능하게 설정한다. 
local_enable=YES : 로컬 사용자의 접속을 가능하게 설정한다.  
write_enable=YES : 로컬 사용자의 쓰기 기능을 가능하게 설정한다. 
anon_upload_enable=YES : 익명 사용자의 파일 업로드를 가능하게 설정한다. 
anon_mkdir_write_enable=YES : 익명 사용자의 디렉토리 생성을 가능하게 설정한다. 
dirmessage_enable=YES : 특정 폴더에 접속시 .message 파일의 메시지를 보여줄 것인지를 지정 하는 설정이다.                              
xferlog_enable=YES : 업로드/다운로드 로그를 xferlog에 기록하겠다는 설정이다. 
connect_from_port_20=YES : ftp 데이터 전송시 20번 포트 사용을 설정한다. 
chown_uploads=YES : 익명 사용자가 업로드한 파일의 소유권을 변경할 때 설정한다. 
chown_username=whoever : chown_uploads=YES일 경우 지정한 사용자 이름으로 익명 사용자가 업로드한 파일의 소유자가 지정된다. 
xferlog_file=/var/log/xferlog : 업로드/다운로드 로그파일을 지정한다. 
xferlog_std_format=YES  : xferlog를 표준 로그포맷으로 기록한다. 
idle_session_timeout=600 : ftp접속의 타임아웃시간을 지정한다. (단위: 초) 
data_connection_timeout=120 : 데이터 전송의 타임아웃시간을 지정한다. (단위: 초) 
nopriv_user=ftpsecure : vsftpd 데몬을 루트가 아닌 시스템에 존재하는 일반 사용자의 비특권 권한으로 동작시킨다. 
async_abor_enable=YES : async_abor_enables 기능을 사용하겠다는 설정이다. 파일전송을 취소하였을때에 취소되지 않는경우 해결할수 있는 옵션, 보안상 이유로 사용하지 않음
ascii_upload_enable=YES : ASCII 모드로 업로드를 허락하겠다는 설정이다. 
ascii_download_enable=YES : ASCII 모드로 다운로드를 허락하겠다는 설정이다. 
ftpd_banner=Welcome to blah FTP service. : ftp 서버 접속시 안내메세지를 출력한다. 
deny_email_enable=YES : 익명사용자 접속시 패스워드를 e-mail형식으로 받겠다는 설정이다. 
banned_email_file=/etc/vsftpd/banned_emails : 허용하지 않을 e-mail 주소를 파일에 넣어두면 접속이 안된다. (banned_emails파일 생성시) 
chroot_local_user=YES  : 전체 사용자가 chroot 기능을 사용하도록 설정한다. 
chroot_list_enable=YES  : chroot_list에 등록된 사용자만 chroot 기능을 사용하도록 설정한다. 
chroot_list_file=/etc/vsftpd/chroot_list : chroot 기능을 사용할 사용자 리스트 파일을 지정한다. 
ls_recurse_enable=YES : ls -R(서브디렉토리 파일 목록 출력) 명령 사용여부를 설정한다. 
listen=NO : 단독 데몬일 경우 listen 을 YES로 지정한다.  
pam_service_name=vsftpd : pam 사용자 인증 설정 
userlist_enable=YES : userlist 사용을 허가하겠다는 설정이다.  :  # userlist_deny=NO : userlist 에 등록된 사용자만 허가하겠다는 설정이다.  
tcp_wrappers=YES : tcp_wrappers 기능을 사용하겠다는 설정이다. (host, ip 차단) /

listen_port : vsftpd 접속 포트

local_umask : 파일 퍼미션 정의

ftp_data_port : Active Mode에서 사용할 FTP-Data 포트를 강제로 변경

 

① listen_port② local_umask③ ftp_data_port

반응형