os_authent_prefix是Oracle用来验证用户尝试连接到server时指定的一个前缀。oracle把该参数的值和操作系统账户名和密码连接起来。当需要连接的时候,Oracle 把带有前缀的操作系统用户名和数据库中Oracle的用户名进行比较。 为了和之前的版本兼容,该参数的默认值为OPS$。当然也可以将该参数设为空,这样可以消除给操作系统的账户添加任何的前缀
remote_os_authent是Oracle允许用户通过采用外部验证的方式登录数据库。默认情况下,只允许本机的用户采用外部验证登录到数据库中。当将remote_os_authent这个参数设置为true时,则允许远端用户采用外部验证的方式登录到数据库中。
限制远程数据库验证
1) 服务器端修改参数及创建用户
——查看参数remote_os_authent:(默认是false)
SYS@ORA11GR2>show parameter remote
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
remote_dependencies_mode string TIMESTAMP
remote_listener string
remote_login_passwordfile string EXCLUSIVE
remote_os_authent boolean FALSE
remote_os_roles boolean FALSE
result_cache_remote_expiration integer 0
SYS@ORA11GR2>alter system set remote_os_authent=true scope=spfile;
System altered.
SYS@ORA11GR2>startup force;(使参数生效)
ORA-32004: obsolete or deprecated parameter(s) specified for RDBMS instance
ORACLE instance started.
Total System Global Area 830930944 bytes
Fixed Size 2257800 bytes
Variable Size 503319672 bytes
Database Buffers 322961408 bytes
Redo Buffers 2392064 bytes
Database mounted.
Database opened.
SYS@ORA11GR2>show parameter remote_
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
remote_dependencies_mode string TIMESTAMP
remote_listener string
remote_login_passwordfile string EXCLUSIVE
remote_os_authent boolean TRUE
remote_os_roles boolean FALSE
result_cache_remote_expiration integer 0
SYS@ORA11GR2>
——查看参数os_authent_prefix
SYS@ORA11GR2>show parameter os_authent_prefix
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
os_authent_prefix string ops$
——创建用户(用户对应的是远程客户端的)
SYS@ORA11GR2>create user ops$wangxuebing identified by externally;
(wangxuebing对应的是本人window下的用户名,因为创建远程登录不必验证密码所以用户名前需加上os_authent_prefix参数对应的值,即用户名为ops$wangxuebing)
User created.
SYS@ORA11GR2>grant connect to ops$wangxuebing;
Grant succeeded.
注 : 如 果 os_authent_prefix 这 个 参 数 不 为 空 , 那 么 , 创 建 外 部 验 证 的 用 户 时 , 需 要 以os_authent_prefix 这个参数的内容开头
2) 来到 windows 客户端,验证远程用户验证
——先查看windows 客户端的网络连接别名为100;(已经提前配置好,查看是否畅通)
TNSPING 100=成功
——在在windows下登录到数据库(注意:正常此种登录一定要加用户名/密码,但是因为进行了上述的操作,就是验证远程登录而且不验证用户名及密码)
远程登录成功(在没有输入账户密码的情况下)
3) 回到服务器端, 将 remote_os_authent 改回默认值 false
SYS@ORA11GR2>alter system set remote_os_authent=false scope=spfile;
System altered.
SYS@ORA11GR2>startup force;
ORA-32004: obsolete or deprecated parameter(s) specified for RDBMS instance
ORACLE instance started.
Total System Global Area 830930944 bytes
Fixed Size 2257800 bytes
Variable Size 503319672 bytes
Database Buffers 322961408 bytes
Redo Buffers 2392064 bytes
Database mounted.
Database opened.
SYS@ORA11GR2>
SYS@ORA11GR2>show parameter remote_os_authent
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
remote_os_authent boolean FALSE
SYS@ORA11GR2>
4) 再回到 windows 客户端测试连接,已无法连接
(参数remote_os_authent与os_authent_prefix 两个值都要满足才可以外部登录无密码)
5) 删除用户回复原貌
SYS@ORA11GR2>drop user ops$wangxuebing;
User dropped.
完成!!!!!!!!!!!!!!!
注意: 1. 客户端的操作系统用户也要是oracle, 这样才能实现远程操作系统认证.
2. remote_os_authent这个参数开启后, 存在很大的安全隐患, 远端服务器只要根据数据库中存在的外部用户来创建用户, 就可以登陆到数据库中, 因此除非 必要, 否则不建议开启这个参数!
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/31397003/viewspace-2126843/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/31397003/viewspace-2126843/