OS: CentOS 6.6
DBMS: IBM DB2 9.1.0.5
위의 환경에서 데이터베이스를 생성하고 JDBC 클라이언트 및 로컬에서 특정 사용자로 접속시도하면 오류가 발생했습니다.
지원되지 않는 패스워드 알고리즘으로 패스워드를 생성한 것이 원인이었습니다.
db2 커맨드로 접속시 발생한 오류
$ db2 connect to dbname user ??? using ???
SQL30082N Security processing failed with reason "15" ("PROCESSING FAILURE").
SQLSTATE=08001
자바(jdbc)를 통한 연결 오류
com.ibm.db2.jcc.am.SqlInvalidAuthorizationSpecException: [jcc][t4][2010][11246][4.16.53] Connection authorization failure occurred. Reason: Local security service non-retryable error. ERRORCODE=-4214, SQLSTATE=28000
아래와 같이 authconfig를 사용하여 현재 설정된 패스워드 알고리즘 방식을 확인합니다.
CentOS 6.6에서는 기본이 sha512 알고리즘을 사용하는 모양입니다.
# authconfig --test | grep password
shadow passwords are enabled
password hashing algorithm is sha512
아래와 같이 authconfig를 사용하여 현재 설정된 패스워드 알고리즘 방식을 확인합니다.
CentOS 6.6에서는 기본으로 sha512 알고리즘을 사용하는 모양입니다. DB2 9.1에서는 Crypt, MD5. SHA1 알고리즘만 지원한다고 합니다.
따라서 아래와 같이 설정하고 DB2 사용자 패스워드 재설정한 후에는 접속이 잘 이루어졌습니다.
# authconfig --passalgo=md5 --update
아래는 해당 내용에 대한 IBM문서입니다. 참고하시기 바랍니다.
SQL30082 RC=24 or RC=15 returned when connecting to database on Server when pwd_algorithm is Crypt, MD5, SHA1, SHA256, SHA512, Blowfish
Problem(Abstract)
A local or remote connection to a database using:
db2 connect to sample user <userid> using <password>
returns
SQL30082N Security processing failed with reason "24" ("USERNAME AND/OR
PASSWORD INVALID"). SQLSTATE=08001
The error in db2diag.log is
2011-01-01-17.21.43.367890-300 I1011620A272 LEVEL: Warning
PID : 123456 TID : 1
FUNCTION: DB2 Common, Security, Users and Groups, secLogMessage, probe:
20
DATA #1 : String, 66 bytes
Password validation for user db2inst1 failed with rc = -2146500507
OR
SQL30082N Security processing failed with Reason Code 15
"Security processing at the server failed "
2011-10-19-14.05.06.682505-300 I2778202A437 LEVEL: Warning
PID : 10813678 TID : 6958 PROC : db2sysc 0
INSTANCE: db2inst1 NODE : 000 DB : CMDB
APPHDL : 0-117
EDUID : 6958 EDUNAME: db2agent (CMDB) 0
FUNCTION: DB2 UDB, bsu security, sqlexLogPluginMessage, probe:20
DATA #1 : String with size, 67 bytes
Password validation for user testuser failed with rc = -2029059891
Symptom
No connections can be made to the database when userid and password are provided. These connections fail with SQL30082N with Reason "24" or "15" returned.
Cause
DB2 Version 9.1 and Version 9.5 up to Fixpack 3 support the following encryption algorithms.
Crypt
MD5
SHA1
From DB2 Version 9.5 Fixpak 4 and versions beyond, the following algorithms are supported:
Crypt
MD5
SHA1
SHA256
SHA512
Blowfish
For example, on AIX this is coded in the /etc/security/login.cfg file.
The error is received if you use the unsupported encryption algorithm and may show up in the db2diag log like this:
2011-10-19-14.05.06.682321-300 I2777674A527 LEVEL: Severe
PID : 9633910 TID : 258 PROC : db2ckpwd 0
INSTANCE: db2inst1 NODE : 000
EDUID : 258 EDUNAME: db2sysc 0
FUNCTION: DB2 UDB, oper system services, sqloGetUserAttribByName, probe:50
MESSAGE : Unsupported password encryption algorithm in use! Configure the
Operating System to use a supported algorithm.
DATA #1 : Hexdump, 4 bytes
0x07000000003F7F00 : 870F 00CD ....
To check what encryption algorithm is being used the login.cfg file will contain something like:
usw:
shells = /bin/sh,/bin/bsh,/bin/csh,/bin/ksh,/bin/tsh,/bin/ksh93,/usr/bin
/sh,/usr/bin/bsh,/usr/bin/csh,/usr/bin/ksh,/usr/bin/tsh,/usr/bin/ksh93,/usr/sbin
/sliplogin,/usr/sbin/uucp/uucico,/usr/sbin/snappd,/bin/false
maxlogins = 32767
logintimeout = 60
pwd_algorithm = sha256
auth_type = STD_AUTH
OR the passwd.txt file will show something like this:
root:
password = {sha256}06$SBysqAi4UQQ1nxC3$L55aKwmscvwxnKskkVrMk0HddbJyNkoE
v6HNXoLO.kH
Environment
Resolving the problem
Please use one of the supported encryption algorithms based on the version of DB2 that is being used.
http://m.blog.naver.com/june0313/50163164703
https://www-304.ibm.com/support/docview.wss?uid=swg21470246
https://www-304.ibm.com/support/docview.wss?uid=swg21416382
http://www-01.ibm.com/support/docview.wss?uid=swg21623221