adutil - Active Directory 유틸리티 소개

적용 대상:SQL Server - Linux

adutil 도구는 Windows Active Directory를 관리하기 위해 Windows 및 Linux 컴퓨터 간에 전환하지 않고 SQL Server on Linux 및 컨테이너에 대한 Active Directory 도메인을 구성하고 관리하기 위한 CLI(명령줄 인터페이스) 유틸리티입니다.

adutil 지원은 SQL Server 사용 사례로만 제한됩니다.

adutil을 사용하여 SQL Server on Linux 또는 컨테이너에 Active Directory 인증을 사용하도록 설정할 필요는 없습니다. 자습서: SQL Server on Linux에서 Active Directory 인증 사용에서 설명한 대로 ktpass 같은 유틸리티를 사용할 수도 있습니다.

adutil 도구는 추가 입력으로 지정하는 추가 플래그를 사용하여 일련의 명령 및 하위 명령으로 설계되었습니다. 각 최상위 명령은 관리 기능의 범주를 표시합니다. 해당 범주 내에서 각 하위 명령은 작업입니다. 이 문서에서는 adutil을 다운로드하고 시작하는 방법을 보여줍니다.

SSL(Secure Sockets Layer)을 통해 LDAP에 대한 adutil 구성

LDAP(Lightweight Directory Access Protocol) 대신 LDAPS(Lightweight Directory Access Protocol over SSL)를 사용해야 합니다. LDAP에 대한 자세한 내용은 LDAP(Lightweight Directory Access Protocol)를 참조하세요.

mssql 사용자 아래에서 실행할 때 /var/opt/mssql/.adutil/adutil.json에 있는 adutil.json 구성 파일에서 useLdaps 옵션을 true로 설정할 수 있습니다. 이 JSON 코드 샘플에서는 설정을 구성하는 방법을 보여줍니다.

{
    "useLdaps": "true"
}

기본적으로 useLDAPS 설정은 false로 설정됩니다. 이 설정을 구성하고 mssql-conf를 사용하여 keytab(키 테이블)을 만들 때 다음 명령을 실행하여 수행할 수 있는 사용자mssql로 mssql-conf를 실행해야 합니다.

sudo su mssql

mssql-conf를 사용하여 keytab을 설정하려면 mssql-conf를 사용하여 SQL Server 서비스 keytab 파일 만들기를 참조 하세요.

adutil 설치

설치하는 동안 EULA를 수락하지 않는 경우 adutil 명령을 처음 실행할 때 플래그를 사용하여 --accept-eula 실행해야 합니다(모든 배포에 대해).

  1. Microsoft Red Hat 리포지토리 구성 파일을 다운로드합니다.

    sudo curl -o /etc/yum.repos.d/msprod.repo https://packages.microsoft.com/config/rhel/8/prod.repo
    
  2. 이전 버전의 미리 보기 adutil을 설치한 경우 아래 명령을 사용하여 이전 adutil 패키지를 모두 제거합니다.

    sudo yum remove adutil-preview
    
  3. 다음 명령을 실행하여 adutil을 설치합니다. ACCEPT_EULA=Y로 설정하면 adutil의 EULA에 동의하는 것입니다. EULA는 /usr/share/adutil/ 경로에 배치됩니다.

    sudo ACCEPT_EULA=Y yum install -y adutil
    

adutil을 사용하여 Windows Active Directory 관리

Active Directory 도메인에 이미 조인된 호스트에 adutil을 다운로드해야 합니다. kinit 명령 및 권한 있는 도메인 계정을 사용하여 Kerberos TGT(티켓 부여 티켓)를 가져오거나 갱신해야 합니다. 사용하는 계정에는 도메인에서 계정 및 SPN(서비스 사용자 이름)을 만들 수 있는 권한이 있어야 합니다.

다음은 adutil을 사용하여 수행할 수 있는 작업의 몇 가지 예입니다. 최상위 명령의 목록을 보려면 adutil --help를 입력하세요. 이 명령은 Active Directory를 관리하고 상호 작용하는 데 사용할 수 있는 최상위 명령을 보여 줍니다.

$ adutil --help
adutil - A general AD utility
  Usage:
    adutil [account|delegation|group|keytab|machine|ou|spn|user|config]
  Subcommands:
    account      Functions for generic account operations
    delegation   Functions for configuring delegation permissions
    group        Functions for group management
    keytab       Functions for keytab management
    machine      Functions for managing machine accounts
    ou           Functions for managing organizational units
    spn          Functions for service principal name (SPN) management
    user         Functions for user account management
    config       Functions for modifying adutil configuration
  Flags:
       --version       Displays the program version string.
    -h --help          Displays help with available flag, subcommand, and positional value parameters.
    -d --debug         Display additional debugging information when making LDAP/Kerberos calls.
       --accept-eula   Accepts the current EULA for adutil. This has no effect if the EULA has already been accepted.

다음 명령 수준에 대한 도움말을 찾으려면 다음 도움말 옵션을 실행할 수 있습니다.

$ adutil spn --help
spn - Functions for service principal name (SPN) management
  Usage:
    spn [add|addauto|delete|search|show]
  Subcommands:
    add       Adds the provided SPNs to an account
    addauto   Automatically generate SPNs based on SPN component inputs and add them to an account
    delete    Deletes the provided SPNs from an account
    search    Search for an SPN by name or list all SPNs in the directory
    show      Get the list of SPNs assigned to an account
  Flags:
    --version       Displays the program version string.
    -h --help          Displays help with available flag, subcommand, and positional value parameters.
    -d --debug         Display additional debugging information when making LDAP/Kerberos calls.
       --accept-eula   Accepts the current EULA for adutil. This has no effect if the EULA has already been accepted.
$ adutil spn search --help
search - Search for an SPN by name or list all SPNs in the directory
  Usage:
     search [name]
  Positional Variables:
    name   OPTIONAL: Name of the SPN to search for in the directory. * can be used as a wildcard
  Flags:
    --version       Displays the program version string.
    -h --help          Displays help with available flag, subcommand, and positional value parameters.
    -n --name          OPTIONAL: Name of the SPN to search for in the directory. * can be used as a wildcard
    -f --filter        OPTIONAL: Filter for the search (User,Machine,Group)
    -o --ouname        OPTIONAL: Distinguished name of OU in which SPNs should be searched. If omitted, the entire directory will be searched.
    -d --debug         Display additional debugging information when making LDAP/Kerberos calls.
       --accept-eula   Accepts the current EULA for adutil. This has no effect if the EULA has already been accepted.

샘플

즉시 시작할 수 있도록 각 명령이 문서화되어 있습니다. 다음은 SQL Server on Linux 및 컨테이너에 대해 Active Directory 인증을 구성하거나 관리할 때 adutil이 사용되는 일반적인 작업 몇 가지입니다.

  • Active Directory 계정 만들기:

    adutil user create --name sqluser --distname CN=sqluser,CN=Users,DC=CONTOSO,DC=COM
    
  • 계정 또는 서비스와 연결된 SPN 만들기:

    adutil spn addauto -n sqluser -s MSSQLSvc -H mymachine.contoso.com -p 1433
    
  • adutil을 사용하여 keytab 만들기:

    adutil keytab createauto -k /var/opt/mssql/secrets/mssql.keytab -p 1433 -H mymachine.contoso.com --password 'P@ssw0rd' -s MSSQLSvc
    

man adutil 명령을 사용하여 adutil의 참조 설명서 페이지를 참조할 수 있습니다.