yum install -y sendmail 로 설치후 rebooting
[root@centos ~]# ps -ef | grep sendmail
root 1845 1 0 22:27 ? 00:00:00 /usr/sbin/sendmail -bd -q1h
root 2203 2144 0 22:28 pts/0 00:00:00 grep --color=auto sendmail
[root@centos ~]# rpm -qa | grep sendmail
sendmail-8.14.7-6.el7.x86_64
[root@centos ~]# whereis sendmail
sendmail: /usr/sbin/sendmail /usr/sbin/sendmail.postfix /usr/sbin/sendmail.sendmail /usr/lib/sendmail.postfix /usr/lib/sendmail.sendmail /usr/lib/sendmail /usr/share/man/man8/sendmail.8.gz
yum install nmap 으로 nmap 설치후 포트 점검
[root@centos ~]# nmap localhost
Starting Nmap 6.40 ( http://nmap.org ) at 2023-07-24 22:34 KST
Nmap scan report for localhost (127.0.0.1)
Host is up (0.000059s latency).
Other addresses for localhost (not scanned): 127.0.0.1
Not shown: 995 closed ports
PORT STATE SERVICE
22/tcp open ssh
25/tcp open smtp
53/tcp open domain
111/tcp open rpcbind
631/tcp open ipp
Nmap done: 1 IP address (1 host up) scanned in 1.72 seconds
[root@centos ~]# cd /etc/mail
[root@centos mail]# ls
Makefile aliasesdb-stamp helpfile mailertable.db sendmail.mc submit.mc virtusertable.db
access domaintable local-host-names make spamassassin trusted-users
access.db domaintable.db mailertable sendmail.cf submit.cf virtusertable
[root@centos mail]# ls -al
합계 228
drwxr-xr-x. 3 root root 4096 7월 25 22:45 .
drwxr-xr-x. 152 root root 12288 7월 25 20:56 ..
-rw-r--r--. 1 root root 92 11월 28 2019 Makefile
-rw-r--r--. 1 root root 469 11월 28 2019 access
-rw-r--r--. 1 root root 469 7월 25 22:45 access.20230725
-rw-r-----. 1 root root 12288 7월 25 22:46 access.db
-rw-r-----. 1 root root 12288 7월 25 22:43 access.db.20230725
-rw-r--r--. 1 root root 0 7월 24 21:31 aliasesdb-stamp
-rw-r--r--. 1 root root 233 11월 28 2019 domaintable
-rw-r-----. 1 root root 12288 7월 24 21:30 domaintable.db
-rw-r--r--. 1 root root 5584 4월 1 2020 helpfile
-rw-r--r--. 1 root root 64 11월 28 2019 local-host-names
-rw-r--r--. 1 root root 997 11월 28 2019 mailertable
-rw-r-----. 1 root root 12288 7월 24 21:30 mailertable.db
-rwxr-xr-x. 1 root root 2700 11월 28 2019 make
-rw-r--r--. 1 root root 58498 4월 1 2020 sendmail.cf
-rw-r--r--. 1 root root 7306 11월 28 2019 sendmail.mc
drwxr-xr-x. 4 root root 247 7월 19 22:35 spamassassin
-rw-r--r--. 1 root root 41680 4월 1 2020 submit.cf
-rw-r--r--. 1 root root 1041 4월 1 2020 submit.mc
-rw-r--r--. 1 root root 127 11월 28 2019 trusted-users
-rw-r--r--. 1 root root 1847 11월 28 2019 virtusertable
-rw-r-----. 1 root root 12288 7월 24 21:30 virtusertable.db
[root@centos mail]# cat 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
[root@centos mail]# cat access.db
▒▒▒▒▒nS▒i▒▒8эh^RELAYconnect:localhostRELAYconnect:127.0.0.1[root@centos mail]#
[root@centos mail]# makemap hash /etc/mail/access.db < /etc/mail/access
service sendmail restart / mailq / 두 가지 명령이 한참 걸림
[root@centos mail]# ls
Makefile access.20230725 access.db.20230725 domaintable helpfile mailertable make sendmail.mc submit.cf trusted-users virtusertable.db
access access.db aliasesdb-stamp domaintable.db local-host-names mailertable.db sendmail.cf spamassassin submit.mc virtusertable
[root@centos mail]# cat local-host-names
# local-host-names - include all aliases for your machine here.
[root@centos mail]# service sendmail restart
Redirecting to /bin/systemctl restart sendmail.service
[root@centos mail]# mail nicebunker@gmail.com
Subject: TEST
Mail Test
.
EOT
[root@centos mail]# mailq
/var/spool/mqueue is empty
Total requests: 0
You have new mail in /var/spool/mail/root
[root@centos mail]#
'정보보안기사 > linux' 카테고리의 다른 글
[실습] snort (0) | 2023.07.25 |
---|---|
[실습] tcp wrapper (0) | 2023.07.24 |
[실습] DNS 관련 (0) | 2023.07.24 |
[실습] DNS 서버 설치#2 (0) | 2023.07.23 |
[실습] 크론탭 (0) | 2023.07.23 |