
콘솔(예: tty1)에 로그인할 때 일반적으로 메시지가 표시됩니다 No mail
. 로그인 시 이메일을 확인하는 프로그램이 있다는 것을 알고 있지만 이를 사용하지 않습니다. 해당 명령을 어떻게 비활성화할 수 있습니까?
/etc/profile.*
및 에서 grep을 시도했지만 ~/.bash*
아무것도 발견되지 않았습니다.
답변1
이 메시지는 모듈에서 제공할 수도 있으므로 pam_mail
바로 grep pam_mail *
들어가서 /etc/pam.d
비활성화할 수 있습니다.
답변2
unset MAILCHECK
에 넣으십시오 .bashrc
.
업데이트
위의 방법은 일관되게 작동하지 않는 것 같습니다(물론 아프지도 않고 어느 정도 작동하는 것처럼 보이지만). 하지만 이 섹션을 확인하세요 /etc/pam.d/login
. 마지막 줄을 주석 처리해 보세요(또는 그래도 작동하지 않으면 언급한 레거시 파일에서 이를 추가로 추적하세요).
# Prints the status of the user's mailbox upon successful login
# (replaces the MAIL_CHECK_ENAB option from login.defs).
#
# This also defines the MAIL environment variable. However, userdel
# also needs MAIL_DIR and MAIL_FILE variables in /etc/login.defs to
# make sure that removing a user also removes the user's mail spool
# file. See the comments in /etc/login.defs.
session optional pam_mail.so standard