명령어/Linux

[RHEL] sss_obfuscate SSSD 비밀번호 난독화

jykim23 2026. 8. 16. 16:35
반응형

부제: sssd.conf에 평문으로 들어갈 바인드 비밀번호를 읽기 어려운 형태로 바꾸는 도구

sss_obfuscate -d LDAP            # LDAP 도메인의 비밀번호를 대화식으로 입력·난독화
sss_obfuscate -d LDAP -s         # stdin으로 비밀번호 전달
sss_obfuscate -d LDAP -f /path/sssd.conf   # 대상 설정 파일 지정
$ sss_obfuscate --help
Usage: sss_obfuscate [options]

sss_obfuscate converts a given password into
human-unreadable format and places it into
appropriate domain section of the SSSD config file.

Options:
  -s, --stdin           Read the password from stdin.
  -d DOMNAME            The domain to use the password in (mandatory)
  -f FILE               Set input file to FILE

sss_obfuscate는 LDAP 바인드 비밀번호처럼 sssd.conf에 저장해야 하는 자격 증명을 평문 대신 난독화된 문자열로 넣어준다. 해당 도메인 섹션에 ldap_default_authtok_type = obfuscated_password와 변환된 토큰을 자동으로 써준다. 주의할 점은 암호화가 아니라 난독화라는 것이다. 되돌릴 수 있으므로 파일 권한(chmod 600)으로 보호하는 것이 여전히 중요하다.

이렇게도 쓴다

특정 도메인을 지정해 대화식으로 비밀번호를 입력한다.

sss_obfuscate -d LDAP

 

스크립트에서 stdin으로 비밀번호를 넘긴다(파이프 조합).

printf '%s' "$PW" | sss_obfuscate -d LDAP -s

 

기본 경로가 아닌 다른 설정 파일을 대상으로 한다.

sss_obfuscate -d LDAP -f /etc/sssd/conf.d/ldap.conf

 

변환 후 해당 섹션에 토큰이 들어갔는지 확인한다(grep 조합).

grep -A2 obfuscated /etc/sssd/sssd.conf

 

설정 파일 권한을 점검해 평문·난독화 파일 노출을 막는다.

stat -c '%a %n' /etc/sssd/sssd.conf
반응형