新聞中心
用戶(hù)別名功能是一項(xiàng)簡(jiǎn)單實(shí)用的郵件賬戶(hù)偽裝技術(shù),可以用來(lái)設(shè)置多個(gè)虛擬信箱的賬戶(hù)以接受發(fā)送的郵件,從而保證自身的郵件地址不被泄露,還可以用來(lái)接收自己的多個(gè)信箱中的郵件。剛才我們已經(jīng)順利地向root賬戶(hù)送了郵件,下面再向bin賬戶(hù)發(fā)送一封郵件,如圖15-14所示。

圖15-14 向服務(wù)器上的bin賬戶(hù)發(fā)送郵件
在郵件發(fā)送后登錄到服務(wù)器,然后嘗試以bin賬戶(hù)的身份登錄。由于bin賬戶(hù)在Linux系統(tǒng)中是系統(tǒng)賬戶(hù),默認(rèn)的Shell終端是/sbin/nologin,因此在以bin賬戶(hù)登錄時(shí),系統(tǒng)會(huì)提示當(dāng)前賬戶(hù)不可用。但是,在電子郵件服務(wù)器上使用mail命令后,卻看到這封原本要發(fā)送給bin賬戶(hù)的郵件已經(jīng)被存放到了root賬戶(hù)的信箱中。
[root@linuxprobe ~]# su - bin
This account is currently not available.
[root@linuxprobe ~]# mail
Heirloom Mail version 12.5 7/5/10.
Type ? for help.
"/var/mail/root": 4 messages 4 new >
U 1 [email protected] Fri Jul 10 09:58 1630/123103 "[abrt] full crash r"
U 2 Anacron Wed Aug 19 17:47 17/619 "Anacron job 'cron.dai"
U 3 boss Sat Aug 15 19:02 118/3604 "Hello~" U
4 boss Wed Aug 19 18:49 116/3231 "你好,用戶(hù)Bin。"
&> 4
Message 4:
From [email protected] Wed Aug 19 18:49:05 2017
Return-Path:
X-Original-To: [email protected]
Delivered-To: [email protected]
From: "boss"
To:
Subject: 你好,用戶(hù)Bin。
Date: Wed, 19 Aug 2017 18:49:05 +0800
Content-Type: multipart/alternative; boundary="----=_NextPart_000_0006_01D0DAAF.
B9104E90"
X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AdDabKrQzUHVBTgRQMaCtUs
VtqfL1Q== Content-Language: zh-cn Status: R Content-Type: text/plain; charset="gb2312"
………………省略部分輸出信息………………
這是一封發(fā)給用戶(hù)Bin的文件。
&> quit
Held 4 messages in /var/mail/root 太奇怪了!明明發(fā)送給bin賬戶(hù)的郵件怎么會(huì)被root賬戶(hù)收到了呢?其實(shí),這就是使用用戶(hù)別名技術(shù)來(lái)實(shí)現(xiàn)的。在aliases郵件別名服務(wù)的配置文件中可以看到,里面定義了大量的用戶(hù)別名,這些用戶(hù)別名大多數(shù)是Linux系統(tǒng)本地的系統(tǒng)賬戶(hù),而在冒號(hào)(:)間隔符后面的root賬戶(hù)則是用來(lái)接收這些賬戶(hù)郵件的人。用戶(hù)別名可以是Linux系統(tǒng)內(nèi)的本地用戶(hù),也可以是完全虛構(gòu)的用戶(hù)名字。
下述命令會(huì)顯示大量的內(nèi)容,考慮到篇幅限制,這里已經(jīng)做了部分刪減,其實(shí)際的輸出名單將是這里的兩倍多。
[root@linuxprobe ~]# cat /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
squid: root
ntp: root
mysql: root
desktop: root
rpcuser: root
rpc: root
nfsnobody: root
ingres: root
system: root
toor: root
manager: root
dumper: root
abuse: root
newsadm: news
newsadmin: news
usenet: news
ftpadm: ftp
ftpadmin: ftp
ftp-adm: ftp
ftp-admin: ftp
www: webmaster
webmaster: root
noc: root
security: root
hostmaster: root
info: postmaster
marketing: postmaster
sales: postmaster
support: postmaster
# trap decode to catch security attacks
decode: root
# Person who should get root's mail
#root: marc現(xiàn)在大家能猜出是怎么一回事了吧。原來(lái)aliases郵件別名服務(wù)的配置文件是專(zhuān)門(mén)用來(lái)定義用戶(hù)別名與郵件接收人的映射。除了使用本地系統(tǒng)中系統(tǒng)賬戶(hù)的名稱(chēng)外,我們還可以自行定義一些別名來(lái)接收郵件。例如,創(chuàng)建一個(gè)名為xxoo的賬戶(hù),而真正接收該賬戶(hù)郵件的應(yīng)該是root賬戶(hù)。
[root@linuxprobe ~]# cat /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.
xxoo: root
bin: root
daemon: root
adm: root
lp: root
………………省略部分輸出信息………………保存并退出aliases郵件別名服務(wù)的配置文件后,需要再執(zhí)行一下newaliases命令,其目的是讓新的用戶(hù)別名配置文件立即生效。然后再次嘗試發(fā)送郵件,如圖15-15所示:
圖15-15 向服務(wù)器上的xxoo賬戶(hù)發(fā)送郵件
這時(shí),使用root賬戶(hù)在服務(wù)器上執(zhí)行mail命令后,就能看到這封原本要發(fā)送給xxoo賬戶(hù)的郵件了。最后,劉遄老師再啰嗦一句,用戶(hù)別名技術(shù)不僅應(yīng)用廣泛,而且配置也很簡(jiǎn)單。所以更要提醒大家的是,今后千萬(wàn)不要看到有些網(wǎng)站上提供了很多客服信箱就輕易相信別人,沒(méi)準(zhǔn)發(fā)往這些客服信箱的郵件會(huì)被同一個(gè)人收到。
[root@linuxprobe ~]# mail
Heirloom Mail version 12.5 7/5/10. Type ? for help.
"/var/mail/root": 5 messages 1 new 4 unread
U 1 [email protected] Fri Jul 10 09:58 1631/123113 "[abrt] full crash report"
U 2 Anacron Wed Aug 19 17:47 18/629 "Anacron job 'cron.daily' on mail.linuxprobe.com"
U 3 boss Wed Aug 19 18:44 114/2975 "hello"
4 boss Wed Aug 19 18:49 117/3242 "你好,用戶(hù)Bin。"
>N 5 boss Wed Aug 19 19:18 115/3254 "這是一封發(fā)送給xxoo用戶(hù)的郵件。" 本文題目:創(chuàng)新互聯(lián)linux教程:15.3設(shè)置用戶(hù)別名郵箱
文章分享:http://m.fisionsoft.com.cn/article/dheosep.html


咨詢(xún)
建站咨詢(xún)
