作者丨eygle
本文为原创文章,如有转载,请标明出处。
导读:在 db2inst1/sqllib/security 目录下,检讨 db2ckpw 和 db2chpw 文件的权限。
有朋友在墨天轮提出一个 DB2 的问题,当完成初始化安装支配之后,本地连接没有问题,但是远程无法连接数据库:
缺点提示是:Error Code -1639 , SQL State: 08001 :
这个缺点有多种可能性,例如防火墙没有开放 50000 端口,但是这个案例,客户已经关闭了防火墙,端口可达。
还有一个干系性问题,便是权限,在 db2inst1/sqllib/security 目录下,检讨 db2ckpw 和 db2chpw 文件的权限:
将这两个文件的属主修正为 root ,权限修正为 4511 ,重启数据库,数据库就可以接管远程访问了:
chown root db2chpwchown root db2ckpwchmod 4511 db2chpwchmod 4511 db2ckpw末了总结一下:db2ckpw 的浸染是用于检讨 DB2 做事器上的用户标识和密码。由于 DB2 依赖于操作系统级别的认证,因此,当某个用户或运用程序连接到做事器上的数据库时,利用该进程验证用户标识和密码。当将 AUTHENTICATION 设置为 SERVER 时,或者当连接是从非安全的操作系统建立的时候,就会进行认证。验证权限须要检讨 passwd 文件,ckpw 顾名思义便是 Check Password file 的含义,正由于如此,这个工具必须以 root 运行,须要远程连接时必须担保该权限。
以下一段描述表述清晰:
db2ckpwd is the password checking daemon that deals with userauthentication. This process is used to confirm that the id exists andhas a right to be on the box. If the process if not a root process, onlylocal connections will be allowed to the database because the id isalready on the box. To make the OS API calls necessary to determine ifthe user has the right to be on the box, DB2’s db2ckpwd must run asroot. If it is not started as root, it will not have permissions to makethe API calls, and it will return an SQL 30082 rc=24 error. Also sincethe db2ckpwd must su to root, in order to run as root, the db2ckpw filewill need to have the su bit set, and the file system must be mounted sothat su’ing is allowed.DB2 建立连接的示意图如下:
记录供参考。
读完本文,以为不足?2019 数据技能嘉年华来啦!
现场大咖云集,与你共畅数据的魅力。现在加入,尽享超低票价优惠: