ETC/자격증

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

AnKiWoong 2022. 3. 30. 20:38
반응형

11. 다음은 NFS 서버에 대한 설정이다. ( 괄호 ) 안에 알맞은 내용을 적으시오.

# vi ( ① )
( ② )

<조  건>
- ① : NFS 서버의 설정 파일명을 절대경로로 기입한다.
- ② : 다음의 두 가지 조건에 해당하는 관련 설정을 한 줄로 기입한다.

가. /data/presales 디렉터리를 *.example.com 도메인 대역에서 접근이 가능하고 읽기, 쓰기가 가능하도록 한다.
나. NFS 클라이언트에서 root 사용자를 NFS 서버상에 root 사용자로 매핑하고 읽기, 쓰기가 가능하도록 설정한다.

 

/etc/exports : NFS Server에서 부팅시에 공유하는 정보를 담는 파일

 

[공유디렉토리]	[접근가능 서버/네트워크] (공유옵션)

 

<공유 옵션>

root_squash : 클라이언트에서 root 사용자를 서버상에서는 nobody 사용자로 매핑한다.
no_root_squash : 서버와 클라이언트 모두 같은 root를 사용한다. 즉, 클라이언트에서의 root 사용자의 요청을 서버의 root 사용자로 매핑한다.
ro : 파일시스템을 읽기 전용(Read Only)로 마운트한다. (EX: ISO파일 같은 변경이 되지않는 파일, 백업의 복구용 파일들)
rw : 파일시스템을 읽고 쓸수 있도록 마운트한다.(Read/Write)
insecure : 인증되지 않은 접근도 가능하도록 한다.
link_relative : 심볼릭 링크를 상대 심볼릭 링크로 바꿀 때 사용한다.
noaccess : 지정된 디렉토리에는 접근을 금지한다. 특정시스템에 대한 공유 디렉토리 일부를 접근 못하게 할 경우에 사용한다.
anonuid, anongid : 익명사용자(Anonymous/Nobody 사용자에 대한 UID/GID 번호 맞추기

 

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

 

EXAMPLE
       # sample /etc/exports file
       /               master(rw) trusty(rw,no_root_squash)
       /projects       proj*.local.domain(rw)
       /usr            *.local.domain(ro) @trusted(rw)
       /home/joe       pc001(rw,all_squash,anonuid=150,anongid=100)
       /pub            *(ro,insecure,all_squash)
       /srv/www        -sync,rw server @trusted @external(ro)
       /foo            2001:db8:9:e54::/64(rw) 192.0.2.0/24(rw)
       /build          buildhost[0-9].local.domain(rw)

       The  first  line  exports  the  entire  filesystem  to machines master and trusty.  In addition to write
       access, all uid squashing is turned off for host trusty. The second and third entry  show  examples  for
       wildcard hostnames and netgroups (this is the entry `@trusted'). The fourth line shows the entry for the
       PC/NFS client discussed above. Line 5 exports the public FTP directory to every host in the world,  exe‐
       cuting all requests under the nobody account. The insecure option in this entry also allows clients with
       NFS implementations that don't use a reserved port for NFS.  The sixth line exports  a  directory  read-
       write to the machine 'server' as well as the `@trusted' netgroup, and read-only to netgroup `@external',
       all three mounts with the `sync' option enabled. The seventh line exports a directory to  both  an  IPv6
       and an IPv4 subnet. The eighth line demonstrates a character class wildcard match.

 

① /etc/exports

② /data/presales *.example.com(rw,no_root_squash)

 

12. 다음은 메일서버 관련 설정을 하는 과정이다. 아래의 조건을 참조하여 ( 괄호 ) 안에 알맞은 내용을 적으시오.

가. 관련 파일 설정
# vi ( ① )
security@seoul.com twins
security@busan.com giants

나. 변경된 설정 적용을 위한 명령 실행
# ( ② ) ( ① ) < ( ① )

 

<조 건>
- ① : 관련 파일명을 절대경로로 기입한다.
- ② : 관련 명령 및 인자값을 기입한다.
- 하나의 메일서버에 seoul.com과 busan.com이라는 두 개의 도메인이 운영 중이다.
- 각 회사에서 security라는 동일한 이메일 계정을 요구한 상태이다.


/etc/mail/virtusertable : 리눅스 sendmail 프로그램에서 특정 이메일 주소로 받은 메일을 다른 사용자에게 할당

makemap hash : /etc/mail/virtusertable 수정 후 적용 명령어

 

[메일주소] [받을 유저]

 

[root@server1 ~]# find / -name virtusertable
/etc/mail/virtusertable

 

[root@server1 ~]# vi /etc/mail/virtusertable

 

# A domain-specific form of aliasing, allowing multiple virtual domains to be
# hosted on one machine.
#
# info@foo.com  foo-info
# info@bar.com  bar-info
# joe@bar.com   error:nouser 550 No such user here
# jax@bar.com   error:5.7.0:550 Address invalid
# @baz.org      jane@example.net
#
# then mail addressed to info@foo.com will be sent to the address foo-info,
# mail addressed to info@bar.com will be delivered to bar-info, and mail
# addressed to anyone at baz.org  will be sent to jane@example.net, mail to
# joe@bar.com will be rejected with the specified error message, and mail to
# jax@bar.com will also have a RFC 1893  compliant error code 5.7.0.
#
# The username from the original address is passed as %1 allowing:
#
# @foo.org      %1@example.com
#
# Additionally, if the local part consists of "user+detail" then "detail" is
# passed as %2 and "+detail" is passed as %3  when a match against user+* is
# attempted, so entries like
#
# old+*@foo.org new+%2@example.com
# gen+*@foo.org %2@example.com
# +*@foo.org    %1%3@example.com
# X++@foo.org   Z%3@example.com
# @bar.org      %1%3
#
# Note: to preserve "+detail" for a default case (@domain) %1%3 must be used
# as RHS. There are two wildcards after "+": "+" matches only a non-empty
# detail, "*" matches also empty details, e.g., user+@foo.org  matches#
# +*@foo.org but not ++@foo.org. This can be used to ensure that the
# parameters %2 and %3 are not empty.
#
# All the host names on the left hand side (foo.com, bar.com, and baz.org)
# must be in class {w} or class {VirtHost}. The latter can be defined by the
# macros VIRTUSER_DOMAIN or VIRTUSER_DOMAIN_FILE (analogously to
# MASQUERADE_DOMAIN and MASQUERADE_DOMAIN_FILE). If VIRTUSER_DOMAIN or
# VIRTUSER_DOMAIN_FILE is used, then the entries of class {VirtHost} are
# added to class {R}, i.e., relaying is allowed to (and from) those domains.

 

① /etc/mail/virtusertable

② makemap hash

 

13. 다음은 Sendmail 설정 관련 파일에 대한 설명이다. ( 괄호 )안에 알맞은 내용을 적으시오.

파일명 설명
/etc/( ① ) 메일 유저 별명 설정 파일
/etc/mail/( ② ) 메일 Relay 제한 및 스팸메일 방지 설정 파일
/etc/mail/( ③ ) 최종 수신지 도메인 설정 파일

<조 건>
- 괄호에는 파일명만 기입한다.

 

/etc/mail/sendmail.cf : sendmail의 핵심. 메일 송/수신 시 이 파일을 해석하여 실행

[root@server1 ~]# m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf


/etc/mail/local-host-names : 메일 서버에서 사용하는 호스트(도메인)을 등록하는 파일


/etc/mail/access : 각종 접근제어 설정이 저장되는 파일

[root@server1 ~]# vi /etc/mail/access
# Check the /usr/share/doc/sendmail/README.cf file for a description
# of the format of this file. (search for access_db in that file)
# The /usr/share/doc/sendmail/README.cf is part of the sendmail-doc
# package.
#
# If you want to use AuthInfo with "M:PLAIN LOGIN", make sure to have the
# cyrus-sasl-plain package installed.
#
# By default we allow relaying from localhost...
Connect:localhost.localdomain           RELAY
Connect:localhost                       RELAY
Connect:127.0.0.1                       RELAY


/etc/aliases : 사용자에게 다른 메일 계정(별칭)을 사용할 수 있도록 해주는 파일

[root@server1 ~]# vi /etc/aliases
#  Aliases in this file will NOT be expanded in the header from
#  Mail, but WILL be visible over networks or from /bin/mail.
#
#       >>>>>>>>>>      The program "newaliases" must be run after
#       >> NOTE >>      this file is updated for any changes to
#       >>>>>>>>>>      show through to sendmail.
#

# Basic system aliases -- these MUST be present.
mailer-daemon:  postmaster
postmaster:     root

# General redirections for pseudo accounts.
bin:            root
daemon:         root
adm:            root
lp:             root
sync:           root
shutdown:       root
halt:           root
mail:           root
news:           root
uucp:           root
operator:       root
games:          root
gopher:         root
ftp:            root
nobody:         root
radiusd:        root
nut:            root
dbus:           root
vcsa:           root
canna:          root
wnn:            root
rpm:            root
nscd:           root
pcap:           root
apache:         root
webalizer:      root
dovecot:        root
fax:            root
quagga:         root
radvd:          root
pvm:            root
amandabackup:           root
privoxy:        root
ident:          root
named:          root
xfs:            root
gdm:            root
mailnull:       root
postgres:       root
sshd:           root
smmsp:          root
postfix:        root
netdump:        root
ldap:           root


/etc/mail/virtusertable : 가상 메일 사용자의 설정이 저장되는 파일

[root@server1 ~]# vi /etc/mail/virtusertable
# A domain-specific form of aliasing, allowing multiple virtual domains to be
# hosted on one machine.
#
# info@foo.com  foo-info
# info@bar.com  bar-info
# joe@bar.com   error:nouser 550 No such user here
# jax@bar.com   error:5.7.0:550 Address invalid
# @baz.org      jane@example.net
#
# then mail addressed to info@foo.com will be sent to the address foo-info,
# mail addressed to info@bar.com will be delivered to bar-info, and mail
# addressed to anyone at baz.org  will be sent to jane@example.net, mail to
# joe@bar.com will be rejected with the specified error message, and mail to
# jax@bar.com will also have a RFC 1893  compliant error code 5.7.0.
#
# The username from the original address is passed as %1 allowing:
#
# @foo.org      %1@example.com
#
# Additionally, if the local part consists of "user+detail" then "detail" is
# passed as %2 and "+detail" is passed as %3  when a match against user+* is
# attempted, so entries like
#
# old+*@foo.org new+%2@example.com
# gen+*@foo.org %2@example.com
# +*@foo.org    %1%3@example.com
# X++@foo.org   Z%3@example.com
# @bar.org      %1%3
#
# Note: to preserve "+detail" for a default case (@domain) %1%3 must be used
# as RHS. There are two wildcards after "+": "+" matches only a non-empty
# detail, "*" matches also empty details, e.g., user+@foo.org  matches#
# +*@foo.org but not ++@foo.org. This can be used to ensure that the
# parameters %2 and %3 are not empty.
#
# All the host names on the left hand side (foo.com, bar.com, and baz.org)
# must be in class {w} or class {VirtHost}. The latter can be defined by the
# macros VIRTUSER_DOMAIN or VIRTUSER_DOMAIN_FILE (analogously to
# MASQUERADE_DOMAIN and MASQUERADE_DOMAIN_FILE). If VIRTUSER_DOMAIN or
# VIRTUSER_DOMAIN_FILE is used, then the entries of class {VirtHost} are
# added to class {R}, i.e., relaying is allowed to (and from) those domains.

 

sendmail 파일 목록

[root@server1 ~]# ll /etc/mail
total 192
-rw-r--r--. 1 root root   469 Nov 28  2019 access
-rw-r-----. 1 root root 12288 Mar 19 11:56 access.db
-rw-r--r--. 1 root root     0 Mar 19 11:56 aliasesdb-stamp
-rw-r--r--. 1 root root   233 Nov 28  2019 domaintable
-rw-r-----. 1 root root 12288 Mar 19 11:56 domaintable.db
-rw-r--r--. 1 root root  5584 Apr  1  2020 helpfile
-rw-r--r--. 1 root root    64 Nov 28  2019 local-host-names
-rw-r--r--. 1 root root   997 Nov 28  2019 mailertable
-rw-r-----. 1 root root 12288 Mar 19 11:56 mailertable.db
-rwxr-xr-x. 1 root root  2700 Nov 28  2019 make
-rw-r--r--. 1 root root    92 Nov 28  2019 Makefile
-rw-r--r--. 1 root root 58498 Apr  1  2020 sendmail.cf
-rw-r--r--. 1 root root  7306 Nov 28  2019 sendmail.mc
-rw-r--r--. 1 root root 41680 Apr  1  2020 submit.cf
-rw-r--r--. 1 root root  1041 Apr  1  2020 submit.mc
-rw-r--r--. 1 root root   127 Nov 28  2019 trusted-users
-rw-r--r--. 1 root root  1847 Nov 28  2019 virtusertable
-rw-r-----. 1 root root 12288 Mar 19 11:56 virtusertable.db

 

① aliases

② access

③ local-host-names

 

반응형