Samba 통합 · 2 min read · Dec 11, 2025

Active Directory 인증을 사용하여 Samba (파일 공유) 통합하는 방법

Active Directory 인증을 사용하여 Samba (파일 공유) 통합하는 방법

이 튜토리얼은 Gentoo samba 서버를 설치하고 ActiveDirectory 권한으로 폴더를 공유하는 방법을 설명합니다.

준비

  • Active Directory가 이미 구현되어 있고 작동 중이어야 합니다. 도움이 필요하면 인터넷에 많은 자료가 있습니다.
  • Windows 시스템이 안전하고 패치되어 있어야 합니다.
  • 물론 Gentoo Linux가 설치되어 있어야 합니다.
  • 구성 파일에서 example.com을 귀하의 도메인에 맞게 변경해야 합니다.

유틸리티 설치

일부 유틸리티를 설치해야 합니다.

  • openldap
  • kerberos
  • samba

# emerge samba

Openldap은 구성할 필요가 없습니다.

Kerberos 구성

이제 파일 /etc/krb5.conf를 다음과 같이 구성합니다.

[libdefaults]         
        ticket_lifetime = 600       
        default_realm = YOURDOMAIN         
        default_tkt_enctypes = des3-hmac-sha1 des-cbc-crc         
        default_tgs_enctypes = des3-hmac-sha1 des-cbc-crc  
[realms]         
        YOURDOMAIN = {         
            kdc = ip of you ads server         
            default_domain = YOURDOMAIN         
        }  
[domain_realm]         
        .yourdomain = YOURDOMAIN         
        yourdomain = YOURDOMAIN  
[kdc]         
        profile = /etc/krb5kdc/kdc.conf  
[logging]         
        kdc = FILE:/var/log/krb5kdc.log         
        admin_server = FILE:/var/log/kadmin.log         
        default = FILE:/var/log/krb5lib.logog  

이 줄을 /etc/hosts에 추가합니다:

xxx.xxx.xxx.xxx    adserver.yourdomain   adserver  

Kerberos를 테스트하여 AD 도메인을 볼 수 있는지 확인합니다. 이 명령을 입력합니다.

kinit Username@DOMAIN  

비밀번호를 요청할 것이며, 올바르게 입력하면 프롬프트로 돌아오게 되며, 이는 작동했음을 의미합니다.

SAMBA 구성

다음 예제 samba 파일을 사용할 수 있습니다: (위치: /etc/samba/smb.conf)

[global]         
    netbios name = name of your server         
    socket options = TCP_NODELAY SO_RCVBUF=16384 SO_SNDBUF=16384         
    idmap uid = 10000-20000         
    winbind enum users = yes         
    winbind gid = 10000-20000         
    workgroup = yourdomain         
    os level = 20         
    winbind enum groups = yes         
    socket address = ip of your ads server         
    password server = *         
    preferred master = no         
    winbind separator = +         
    max log size = 50         
    log file = /var/log/samba3/log.%m         
    encrypt passwords = yes         
    dns proxy = no         
    realm = YOURDOMAIN         
    security = ADS         
    wins server = ip of your wins server         
    wins proxy = no  
[exampleshare]         
    comment = a comment         
    path = /home/exampleshare         
    browseable = yes         
    read only = no         
    inherit acls = yes         
    inherit permissions = yes         
    create mask = 700         
    directory mask = 700         
    valid users = @"DOMAIN+Domain Users"   <-- define your ADS groups         
    admin users = @"DOMAIN+Domain Admins"  <-- define your ads groups with admin rights  

이제 samba를 실행합니다.

# /etc/init.d/samba start  

이 명령을 입력하여 samba 서버를 도메인에 가입시킵니다.

# net ads join -U Username  

윈바인드를 테스트하여 Windows 인증이 실제로 작동하는지 확인합니다. 파일 /etc/nsswitch.conf를 편집하고 두 줄을 다음과 같이 변경해야 합니다.

passwd:     compat winbind  
shadow:     compat  
group:      compat winbind  

winbindd 데몬을 시작합니다.

# winbindd  

winbindd를 /etc/conf.d/local.start에 추가합니다.

# echo "/usr/bin/winbindd" >> /etc/conf.d/local.start  

samba를 rc 기본에 추가합니다.

# rc-update add samba default  

SAMBA 서버 테스트

Active Directory의 내용을 볼 수 있는지 확인합시다. 이 명령을 입력합니다.

# wbinfo -u 

Active Directory의 사용자 목록을 볼 수 있습니까?

그룹을 보려면 다음을 입력합니다.

# wbinfo -g  

공유 구성

아직 공유를 구성하지 않았다면 지금 하세요 ;)

ACL 지원

커널에서 ACL 지원을 활성화해야 합니다.

이제 /etc/fstab을 편집하고 옵션에 acl을 다음과 같이 추가합니다:

/dev/sda4               /home           reiserfs        noatime,acl             0 0  

도메인 그룹을 공유에 설정

다음 명령으로 공유에 그룹을 추가할 수 있습니다.

# setfacl -m g:"DOMAIN+YourGroup":rwx .  

링크

http://forums.gentoo.org/viewtopic.php?p=706581#706581
samba 메일링 리스트
http://www.samba.org

Share: X/Twitter LinkedIn

새 게시물을 받은 편지함에서 받기

스팸은 없습니다. 언제든지 구독 해지 가능합니다.