ITPub博客

首页 > 数据库 > Oracle > 外部OS认证的过程

外部OS认证的过程

原创 Oracle 作者:jolly10 时间:2009-05-22 15:30:56 0 删除 编辑

今天看到贴子http://www.itpub.net/thread-1167197-1-3.html

我也来试一下外部认证,过程如下:

[@more@]server是linux4 U4+oracle10.2.0.1

1、保证参数remote_os_authent=true

SQL*Plus: Release 10.2.0.1.0 - Production on Fri May 22 14:26:04 2009

Copyright (c) 1982, 2005, Oracle. All rights reserved.

SQL> conn sys/sys@orcl140 as sysdba
Connected.
SQL> show parameter remote_os_authent

NAME TYPE
------------------------------------ ---------------------------------
VALUE
------------------------------
remote_os_authent boolean
FALSE


SQL> alter system set remote_os_authent=true scope=spfile;

System altered.

SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.

SQL> startup
ORACLE instance started.

Total System Global Area 289406976 bytes
Fixed Size 1219016 bytes
Variable Size 92276280 bytes
Database Buffers 192937984 bytes
Redo Buffers 2973696 bytes
Database mounted.
Database opened.

SQL> show parameter os_auth

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
os_authent_prefix string ops$
remote_os_authent boolean TRUE

2.建立用户,由于os_authent_prefix不为空,建立用户时需要在用户前加上此字串,密码一定是externally


SQL>
SQL> create user "OPS$L5M" identified by externally;

User created.

SQL> grant connect to "OPS$L5M";

Grant succeeded.

3.试着连接

SQL> conn / @orcl140
Connected.

SQL> show user
USER is "OPS$L5M"


如果修改os_authent_prefix为空值后再试试

SQL> alter system set os_authent_prefix='' scope=spfile;

System altered.

重新启动数据库后

SQL> sqlplus / @orcl140

SQL> drop user OPS$L5M;

User dropped.

SQL> create user l5m identified externally;

User created.

SQL> grant connect to l5m;

Grant succeeded.

SQL> conn / @orcl140
Connected.

取消掉前掇也是可以的。

不过发现一个问题,在有前掇OPS时建立用户是用的identified by ,而取消前掇时用的identified 没有by.



SQL> drop user l5m;

User dropped.


SQL> create user l5m identified by externally;

User created.

SQL> select username,password from dba_users where username='L5M';

USERNAME
----------------------------------------------------------------------------
PASSWORD
----------------------------------------------------------------------------
L5M
E5FDA935BBB4F154

SQL> conn / @orcl140
ERROR:
ORA-01017: invalid username/password; logon denied


Warning: You are no longer connected to ORACLE.

SQL> conn l5m/externally@orcl140
Connected.


将externally当成密码了,所以如果取消前掇时建立用户一定不要用identified by,直接用identified。

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/271283/viewspace-1022393/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2008-02-20

  • 博文量
    263
  • 访问量
    826723