Image

지식 기반 → 해결 방법: ProFTPD, SSH에서 권한 부여가 느림

[가상 서버]
출판 날짜: 02.06.2025

얼마 전 Linux Debian 12에서 PAM.d 서비스에 대한 업데이트가 릴리스되었습니다. 이러한 서비스에 대한 업데이트는 매우 드물며, 업데이트 후 로그인 시도가 오래 지연되는 현상이 관찰되었습니다:

ProFTPd

우리의 경우, 이 서비스는 xinetd 서비스를 통해 실행되며 독립적인 서비스가 아니므로 인증은 PAM.d를 통해 이루어집니다.

SSH

구성 파일의 옵션은 기본적으로 활성화되어 있었습니다:

UsePAM yes

따라서 두 서비스 모두 PAM.d 설정에 의존합니다.

해결책

긴 지연의 원인은 구성 파일에 다음 줄이 포함되어 있기 때문이었습니다:

session	optional	pam_systemd.so

구성 파일 경로:

/etc/pam.d/common-session

해당 줄을 제거한 후 파일은 다음과 같이 보여야 합니다:

#
# /etc/pam.d/common-session - session-related modules common to all services
#
# This file is included from other service-specific PAM config files,
# and should contain a list of modules that define tasks to be performed
# at the start and end of interactive sessions.
#
# As of pam 1.0.1-6, this file is managed by pam-auth-update by default.
# To take advantage of this, it is recommended that you configure any
# local modules either before or after the default block, and use
# pam-auth-update to manage selection of other modules.  See
# pam-auth-update(8) for details.

# here are the per-package modules (the "Primary" block)
session	[default=1]			pam_permit.so
# here's the fallback if no module succeeds
session	requisite			pam_deny.so
# prime the stack with a positive return value if there isn't one already;
# this avoids us returning an error just because nothing sets a success code
# since the modules above will each just jump around
session	required			pam_permit.so
# and here are more per-package modules (the "Additional" block)
session	required	pam_unix.so 
# end of pam-auth-update config

이러한 변경을 적용한 후 인증은 다시 빠르게 작동하며 지연 없이 처리됩니다.

관련 기사: SSH 연결 시 긴 지연의 원인 및 문제 해결





No Comments Yet