안녕리눅스 3 User Guide
  • Introduction
  • Chapter 1. 안녕 리눅스 3 \/ CentOS 7.2 차이점
  • Chapter 2. Access Control
    • 안녕 리눅스 방화벽 설정
      • 기본 설정
      • Inbound 제어
      • Outbound 제어
      • brute force attack 제어
      • User defined rule 제어
      • 특정 국가에서의 접속 제어
      • oops-firewall 실행 방법
    • Shell login Control (with PAM)
      • login 가능한 account 제한
      • login account chroot
      • Google OTP를 이용한 2 factor 인증
    • 인증 통합 (Authentification\/Authorization Intergrate)
      • Openldap
        • Master Server 설정
        • SSL 설정
        • Slave Server 설정
        • Replication 설정
        • LDAP 클라이언트 인증 연동 설정
        • LDAP data 관리
        • Sudo LDAP 연동
      • NIS
      • Active Directory
  • Chapter 3. Web control
    • httpd
    • nginx
    • lighttpd
    • PHP
    • Web Access Control
      • Apache 2.4
      • Nginx
      • lighttpd
    • Web Monitor agent
  • Chapter 4. JVM 운영
  • Chapter 5. DNS 운영
    • 기본 설정
    • 신규 도메인 설정
    • Slave DNS 구성
    • Inverse Domain 설정
    • DNSSEC 설정
    • GeoDNS 설정
    • Domain 위임
    • IDN
    • Troble Shooting
  • Chapter 6. Time Server 운영
    • Chrony
    • NTP
  • Chapter 7. VPN 운영
  • Chapter 8. SMTP 운영
  • 안녕 리눅스 White Paper
    • Disk Partition Aligment
  • 안녕 리눅스 알려진 버그
  • 안녕 리눅스 3 패키지 일람
    • [AN:core]
      • annyung-release
      • byspam
      • check-utils
      • genpasswd
      • httpd-conf
      • httpd-krisp
      • httpd-nis
      • httpd-url
      • kmod-geoip
      • l4vip
      • ldap-auth-utils
      • libchardet
      • libimginfo
      • libipcalc
      • libkrisp
      • mariadb-aes256
      • olibc
      • oops-firewall
      • perl-KRISP
      • perl-ModuleList
      • php-chardet
      • php56-chardet
      • php71-chardet
      • php-common
      • php56-common
      • php71-common
      • php-fpm-conf
      • php56-fpm-conf
      • php71-fpm-conf
      • php-geoip
      • php56-geoip
      • php71-geoip
      • php-korean
      • php56-korean
      • php71-korean
      • php-krisp
      • php56-krisp
      • php71-krisp
      • php-nis
      • php56-nis
      • php71-nis
      • php-pear-KSC5601
      • php-pear-ipcalc
      • php-pear-krisp
      • php-pear-oops-key
      • procdump
      • python-chardet
      • python-krisp
      • remount
      • utf8-profile
      • whois
      • yum-annyung
    • [AN:base]
      • apr
      • authconfig
      • bash
      • bind
      • chrony
      • coreutils
      • ctags
      • cvs
      • ecj
      • filesystem
      • GeoIP
      • gperftools
      • httpd
      • initscrtips
      • iptables
      • java-1.8.0-openjdk
      • javapacakges-tools
      • linuxdoc-tools
      • mariadb
      • memcached
      • net-tools
      • ntp
      • openssh
      • openssl
      • pam
      • php
      • procmail
      • procps-ng
      • redhat-rpm-config
      • rootfiles
      • rsyslog
      • sendmail
      • setup
      • shadow-utils
      • sudo
      • systemd
      • sysvinit-tools
      • tomcat
      • traceroute
      • unzip
      • util-linux
      • vim
      • xinted
    • [AN:xless]
    • [AN:addon]
      • authbind
      • cronolog
      • google-authenticator
      • hping3
      • httpd-fcgid
      • imap
      • jfbterm
      • jlint
      • libevent14
      • libnet
      • libnetfilter_acct
      • lighttpd
      • mhash
      • mimetex
      • mm
      • netdata
      • netperf
      • nginx
      • openvpn
      • pdnsd
      • perl-CSS-DOM
      • php-pecl-apcu
      • php56-pecl-apcu
      • php71-pecl-apcu
      • php-pecl-memcache
      • php56-pecl-memcache
      • php71-pecl-memcache
      • php-pecl-oauth
      • php56-pecl-oauth
      • php71-pecl-oauth
      • php-pecl-xdebug
      • php56-pecl-xdebug
      • php71-pecl-xdebug
      • php56
      • php71
      • proftpd
      • python-Mako
      • python-MarkupSafe
      • python-mcrypt
      • python-openpyxl
      • python-xlrd
      • re2c
      • redis
      • rudiments
      • splint
      • sqlite32
      • sqlrelay
      • tomcat-native
    • [AN:plus]
  • 안녕 리눅스 Upgrade Guide
Powered by GitBook
On this page

Was this helpful?

  1. Chapter 2. Access Control
  2. Shell login Control (with PAM)

login 가능한 account 제한

LDAP이나 AD, NIS등으로 인증 통합을 했을 경우, login이 필요없는 account가 대부분 입니다. 또는 서버마다 경우가 틀릴 수 있습니다.

이런 경우, pam_access 모듈을 이용하여 필요한 account만 login을 가능하도록 설정 하는 방법에 대하여 기술 합니다.

참고 LDAP 연동시에는 LDAP의 host attribute를 이용하여 host 별로 인증을 제한할 수 있으며, 안녕 리눅스의 LDAP 인증 통합 문서에서 따로 다루게 됩니다. 그러므로 LDAP을 사용하여 인증 통합시에는 이 방법 보다는 LDAP에서의 제어를 이용 하십시오.

[root@an3 ~]$ cat /etc/pam.d/password-auth-ac
#%PAM-1.0
# This file is auto-generated.
# User changes will be destroyed the next time authconfig is run.
auth        required      pam_tally2.so deny=4 unlock_time=120
auth        required      pam_env.so
auth        sufficient    pam_unix.so nullok nodelay try_first_pass
auth        requisite     pam_succeed_if.so uid >= 1000 quiet_success
auth        required      pam_deny.so

account     required      pam_access.so
account     required      pam_tally2.so
account     required      pam_unix.so
account     sufficient    pam_localuser.so
account     sufficient    pam_succeed_if.so uid < 1000 quiet
account     required      pam_permit.so

password    requisite     pam_pwquality.so try_first_pass local_users_only retry=3 authtok_type= difok=1 minlen=8 minclass=3
password    sufficient    pam_unix.so sha512 shadow nullok try_first_pass use_authtok remember=4
password    required      pam_deny.so

session     optional      pam_keyinit.so revoke
session     required      pam_limits.so
-session     optional      pam_systemd.so
session     [success=1 default=ignore] pam_succeed_if.so service in crond quiet use_uid
session     required      pam_unix.so
[root@an3 ~]$

다음, /etc/security/access.conf 에서 login 가능한 account, group 설정을 하도록 합니다.

[root@an3 ~]$ cat /etc/security/access.conf
+:root wheel:ALL
+:emer kss oops:ALL
+:kldp:LOCAL
-:ALL:ALL
[root@an3 ~]$

문법은 다음과 같이 3개의 field로 구성 됩니다.

[CONDITION]:[USER or GROUP]:[ORIGIN]

문법에 대한 자세한 예제는 /etc/security/access.conf를 참고 하십시오.

  • CONDITION

    • + 또는 -로 설정.

    • +는 PERMIT

    • -는 DENY를 의미

  • USER or GROUP

    • user 또는 group 을 기록

    • 공백 문자를 구분자로 복수 등록 가능

    • user와 gruop을 따로 구분하지 않기 때문에 동일한 user와 gruop간에 의도치 않은 결과 발생 가능하니 주의해야 함

    • netgroup의 경우에는 @를 앞에 붙여줍니다. (@netgroup)

  • ORIGIN

    • 접근 시도 장소(?)

    • tty name, IPv4, IPv6, domain name, LOCAL, NONE, ALL 을 사용 가능

상단의 /etc/security/access.conf 의 의미는 다음과 같습니다.

  1. root와 wheel group login permit

  2. emer/kss/oops account or group login permit

  3. kldp account or group은 LOCAL에서만 permit

  4. 1~3 조건에 해당하지 않으면, 모두 deny

PreviousShell login Control (with PAM)Nextlogin account chroot

Last updated 5 years ago

Was this helpful?

위의 설정과 같이 account section의 가장 상단에 pam_access.so를 required로 설정 합니다. pam_access 모듈의 option에 대해서는 를 참고 하십시오.

"man pam_access"