红联Linux门户
Linux帮助

Oracle 9i密码策略--密码重用规则

发布时间:2006-08-18 00:08:41来源:红联作者:Explore
  Oracle通过PROFILE中的PASSWORD_REUSE_TIME和PASSWORD_REUSE_MAX来确定密码是否可以重用以及密码重用的限制。


  但是,经过测试,发现Oracle的ADMINISTRATOR GUIDE里面的描述是错误的,我查阅了一下METALINK,METALINK上的一篇文章虽然对这两个参数进行了比较详细的说明,但是仍然有一部分描述是错误。


  PASSWORD_REUSE_TIME是重用密码的最小时间间隔,单位是天。可以给出整数或分数,如1/1440表示1分钟(出于效率的考虑,oracle不会每分钟都去进行检查,一般来说,有5分钟左右的误差,因此如果这个数小于1/144则没有多大的意义)。


  PASSWORD_REUSE_MAX是重用密码前更换密码的最小次数。这两项本身没有任何异议,关键是两项如何配合使用。可以分为3种情况进行描述:


一、PASSWORD_REUSE_MAX和PASSWORD_REUSE_TIME都为UNLIMITED


  这时密码可以任意重用,没有限制这也是DEFAULT profile的默认值。当这两项都为UNLIMITED时,认为这两个参数没有使用,因此,密码重用没有任何限制。


锟斤拷锟斤拷:
SQL> create profile prof_test limit password_reuse_max unlimited
2password_reuse_time unlimited;
配置文件已创建
SQL> create user test identified by test profile prof_test;
用户已创建
SQL> alter user test identified by test;
用户已更改。
SQL> alter user test identified by test;
用户已更改。




二、PASSWORD_REUSE_MAX和PASSWORD_REUSE_TIME中有一个为UNLIMITED,另一个为其他值。


  这个时候你的密码将永远无法重用。


  看看administrator guide上是怎么说的:


锟斤拷锟斤拷:
Use the CREATE PROFILE statement to specify a time interval during which users
cannot reuse a password. In the following statement, a profile is defined where
the PASSWORD_REUSE_TIME clause specifies that the user cannot reuse the
password
for 60 days.

CREATE PROFILE prof LIMIT
PASSWORD_REUSE_TIME 60
PASSWORD_REUSE_MAX UNLIMITED;

In the next statement, the PASSWORD_REUSE_MAX clause specifies that the number
of password changes the user must make before the current password can be used
again is three.

CREATE PROFILE prof LIMIT
PASSWORD_REUSE_MAX 3
PASSWORD_REUSE_TIME UNLIMITED;

Note: If you specify PASSWORD_REUSE_TIME or PASSWORD_REUSE_MAX, you must set
the other to UNLIMITED or not specify it at all.





  文档告诉我们,只使用其中一个,把另外一个设置为UNLIMITED,但是这是不正确的,这样会导致你的密码永远无法重用。


锟斤拷锟斤拷:
SQL> alter profile prof_test limit password_reuse_max 3;

配置文件已更改

SQL> select resource_name, limit from dba_profiles
2where profile = 'PROF_TEST' and resource_type = 'PASSWORD';

RESOURCE_NAMELIMIT
-------------------------------- ----------------------------------------
FAILED_LOGIN_ATTEMPTSDEFAULT
PASSWORD_LIFE_TIMEDEFAULT
PASSWORD_REUSE_TIMEUNLIMITED
PASSWORD_REUSE_MAX3
PASSWORD_VERIFY_FUNCTIONDEFAULT
PASSWORD_LOCK_TIMEDEFAULT
PASSWORD_GRACE_TIMEDEFAULT

已选择7行。

SQL> alter user test identified by test;
用户已更改。
SQL> alter user test identified by test;
alter user test identified by test
*
ERROR 位于第 1 行:
ORA-28007: 无法重新使用口令
SQL> alter user test identified by t1;
用户已更改。
SQL> alter user test identified by t2;
用户已更改。
SQL> alter user test identified by t3;
用户已更改。
SQL> alter user test identified by test;
alter user test identified by test
*
ERROR 位于第 1 行:
ORA-28007: 无法重新使用口令


  修改profile后,只对test用户的后续操作有效,第一次可以修改密码为test是因为oracle没有记录初始密码,而第二次修改就会失败,因为密码已经不能重用了。


  根据文档,我们只需要修改密码三次,就可以重用,但是测试的结果确是密码无法在重用。


锟斤拷锟斤拷:
SQL> alter profile prof_test limit password_reuse_max unlimited;
配置文件已更改
SQL> alter user test identified by test;
用户已更改。
SQL> alter profile prof_test limit password_reuse_time 1/144;
配置文件已更改
SQL> select resource_name, limit from dba_profiles
2where profile = 'PROF_TEST' and resource_type = 'PASSWORD';

RESOURCE_NAMELIMIT
-------------------------------- ----------------------------------------
FAILED_LOGIN_ATTEMPTSDEFAULT
PASSWORD_LIFE_TIMEDEFAULT
PASSWORD_REUSE_TIME.0069
PASSWORD_REUSE_MAXUNLIMITED
PASSWORD_VERIFY_FUNCTIONDEFAULT
PASSWORD_LOCK_TIMEDEFAULT
PASSWORD_GRACE_TIMEDEFAULT
已选择7行。
SQL> set time on
16:47:29 SQL> alter user test identified by test;
alter user test identified by test
*
ERROR 位于第 1 行:
ORA-28007: 无法重新使用口令
16:47:48 SQL>
16:48:23 SQL>
16:59:45 SQL> alter user test identified by test;
alter user test identified by test
*
ERROR 位于第 1 行:
ORA-28007: 无法重新使用口令
16:59:59 SQL>
17:07:32 SQL> alter user test identified by test;
alter user test identified by test
*
ERROR 位于第 1 行:
ORA-28007: 无法重新使用口令
17:07:40 SQL> set time off




  修改PASSWORD_REUSE_TIME为1/144,也就是说大概10分钟的时间,考虑的oracle的误差,我们在10分钟和20分钟后分别进行测试。结果发现密码仍然无法重用。


三、PASSWORD_REUSE_MAX和PASSWORD_REUSE_TIME都不为UNLIMITED。


  这时只需满足任意一个条件就可以重用密码


  Metalink上的文章在这里描述有误,密码重用不需要同时满足两个条件,只要满足一个既可。


锟斤拷锟斤拷:
SQL> alter profile prof_test limit password_reuse_time unlimited;
配置文件已更改
SQL> alter user test identified by test;
用户已更改。
SQL> alter profile prof_test limit
2password_reuse_max 3 password_reuse_time 1/144;
配置文件已更改
SQL> set time on
17:11:30 SQL> alter user test identified by test;
用户已更改。
17:11:47 SQL> alter user test identified by test;
alter user test identified by test
*
ERROR 位于第 1 行:
ORA-28007: 无法重新使用口令
17:11:56 SQL> alter user test identified by t1;
用户已更改。
17:12:06 SQL> alter user test identified by t2;
用户已更改。
17:12:12 SQL> alter user test identified by t3;
用户已更改。
17:12:19 SQL> alter user test identified by test;
用户已更改。
17:12:50 SQL>
17:13:45 SQL> alter user test identified by test;
alter user test identified by test
*
ERROR 位于第 1 行:
ORA-28007: 无法重新使用口令
17:13:55 SQL>
17:14:00 SQL>
17:32:14 SQL> alter user test identified by test;
用户已更改。




  第一次重用test密码才过了1分钟左右,而在第二次重用test密码之前并没有使用过其他密码。可见,只需满足PASSWORD_REUSE_MAX和PASSWORD_REUSE_TIME中的任意一个条件就可以。
文章评论

共有 100 条评论

  1. 128.46.89.* 于 2007-09-05 02:55:01发表:

    http://emeraldring.fora.pl/
    http://emeraldring.fora.pl/
    http://emeraldring.fora.pl/ - emerald cut wedding ring

  2. 61.152.108.* 于 2007-09-05 02:54:57发表:

    http://emeraldring.fora.pl/
    http://emeraldring.fora.pl/
    http://emeraldring.fora.pl/ - emerald cut wedding ring

  3. 68.180.195.* 于 2007-09-01 21:02:21发表:

    Hi, nice very nice page..!
    abb fund
    fund raising cook book
    abb fund
    fund raising cook book - http://fund.freewebpages.org/alaska-permanent-fund-dividend/index.html
    fund

    Good luck !
    PS: do you listen Linkin Park ?

  4. 207.44.238.* 于 2007-08-31 08:45:33发表:

    Hi, nice very nice page..!
    fund raising counselor organization
    unique fund raising
    abb fund
    alaska permanent fund dividend
    abb fund - http://fund.freewebpages.org/mutual-fund-company/index.html

    Good luck !
    PS: do you listen Linkin Park ?

  5. 213.3.4.* 于 2007-08-31 08:45:07发表:

    Hi, nice very nice page..!
    fund raising counselor organization
    unique fund raising
    abb fund
    alaska permanent fund dividend
    abb fund - http://fund.freewebpages.org/mutual-fund-company/index.html

    Good luck !
    PS: do you listen Linkin Park ?

  6. 68.180.195.* 于 2007-08-30 02:31:37发表:

    Hi, nice very nice page..!
    fund raising event
    growth fund of america
    sample fund raising letter - http://fund.freewebpages.org/child-defense-fund/index.html
    hedge funds - http://fund.freewebpages.org/child-defense-fund/index.html
    fund raising event

    Good luck !
    PS: do you listen Linkin Park ?

  7. 0.0.0.* 于 2007-08-30 02:31:36发表:

    Hi, nice very nice page..!
    fund raising event
    growth fund of america
    sample fund raising letter - http://fund.freewebpages.org/child-defense-fund/index.html
    hedge funds - http://fund.freewebpages.org/child-defense-fund/index.html
    fund raising event

    Good luck !
    PS: do you listen Linkin Park ?

  8. 81.170.101.* 于 2007-08-28 21:33:33发表:

    Hi, nice very nice page..!
    money market rate - http://www.volny.cz/moneymarket1/money-market-savings-account/
    cnn money market stock
    money market mutual funds
    best money market rate
    money market interest rate - http://www.volny.cz/marketaccount/money-market-account-rate/

    Good luck !
    PS: do you listen Linkin Park ?

  9. 211.154.104.* 于 2007-08-27 06:09:55发表:

    Hi, nice very nice page..!
    make money in stock market
    money market funds
    high yield money market account
    money market mutual funds
    money market mutual funds

    Good luck !
    PS: do you listen Linkin Park ?

  10. 0.0.0.* 于 2007-08-25 08:43:49发表:

    Hi, nice very nice page..!
    best money market rate
    money market fund - http://www.volny.cz/moneyrate/money-banking-and-financial-market/
    money market fund
    make money in stock market
    high yield money market account

    Good luck !
    PS: do you listen Linkin Park ?

  11. 221.232.159.* 于 2007-08-23 18:38:18发表:

    Hi, nice very nice page..!
    cnn money market stock - http://volny.cz/highestmoney/high-yield-money-market/
    vanguard money market funds - http://www.volny.cz/moneymarket/money-market-fund
    money market interest rate
    money market mutual funds
    make money in stock market - http://volny.cz/highestmoney/cnn-money-market-stock/

    Good luck !
    PS: do you listen Linkin Park ?

  12. 209.6.21.* 于 2007-08-14 06:35:12发表:

    good work !
    chandelier lamp shades
    chandelier lamp shades
    chandelier lamp shades - www.desklamp1.fora.pl


    buy viagra online
    buy viagra online
    buy viagra online - www.buyviagraonlinex.fora.pl

    .
    norwegian pearl
    norwegian pearl
    norwegian pearl - http://volny.cz/norwegianpearl
    blackberry pearl white
    blackberry pearl white
    blackberry pearl white - http://volny.cz/blackberrypearlwhite
    pink pearls
    pink pearls
    pink pearls - http://volny.cz/pinkpearls
    blackberry pearl review
    blackberry pearl review
    blackberry pearl review - http://volny.cz/blackberrypearlrev
    pearl white
    pearl white
    pearl white - http://volny.cz/pearlwhite
    good luck

  13. 193.111.198.* 于 2007-08-14 02:28:55发表:

    good work !
    chandelier lamp shades
    chandelier lamp shades
    chandelier lamp shades - www.desklamp1.fora.pl


    buy viagra online
    buy viagra online
    buy viagra online - www.buyviagraonlinex.fora.pl

    .
    norwegian pearl
    norwegian pearl
    norwegian pearl - http://volny.cz/norwegianpearl
    blackberry pearl white
    blackberry pearl white
    blackberry pearl white - http://volny.cz/blackberrypearlwhite
    pink pearls
    pink pearls
    pink pearls - http://volny.cz/pinkpearls
    blackberry pearl review
    blackberry pearl review
    blackberry pearl review - http://volny.cz/blackberrypearlrev
    pearl white
    pearl white
    pearl white - http://volny.cz/pearlwhite
    good luck

  14. 124.128.14.* 于 2007-08-12 20:16:11发表:

    saltwater pearls
    saltwater pearls
    saltwater pearls - volny.cz/saltwaterpearls
    freshwater pearl jewelry
    freshwater pearl jewelry
    freshwater pearl jewelry - volny.cz/freshwaterpearljew
    cultured pearl jewelry
    cultured pearl jewelry
    cultured pearl jewelry - volny.cz/culturedpearljewelry
    black pearl earring
    black pearl earring
    black pearl earring - volny.cz/blackpearlearring
    pearl s buck
    pearl s buck
    pearl s buck - volny.cz/pearlsbuck

  15. 201.65.89.* 于 2007-08-09 02:17:43发表:

    Hi, nice very nice page..!
    ford dealer clearanceford dealer clearanceford dealer clearance - www.volny.cz/forddealer
    blackberry buy pearl blackberry buy pearl blackberry buy pearl - http://volny.cz/blackberrybuypearl
    gmc in chicago gmc in chicago gmc in chicago - www.volny.cz/gmcyokun/
    lexus is250 review lexus is250 review lexus is250 review - www.volny.cz/lexus250/
    356 porsche sale 356 porsche sale 356 porsche sale - www.volny.cz/porsche356

    Good luck !
    PS: do you listen Linkin Park ?

  16. 202.44.8.* 于 2007-08-07 05:03:22发表:

    desk lamp
    desk lamp - www.halogendesklamp.freehostia.com/desk-lamp/

    lamp shades
    lamp shades - www.halogendesklamp.freehostia.com/lamp-shades/

    office desk lamp
    office desk lamp - www.halogendesklamp.freehostia.com/office-desk-lamp/

  17. 217.141.105.* 于 2007-08-03 11:11:15发表:

    thnx... nice site
    and i wan't see my:
    http://www.tablelamp.fora.pl/
    http://www.tablelamp.fora.pl/
    http://www.tablelamp.fora.pl/ - table lamp

  18. 59.95.181.* 于 2007-08-01 22:36:08发表:

    art bondage http://cartoonfox.150m.com/art_bondage.html art bondage art bondage
    comic book bondage http://cartoonfox.150m.com/comic_book_bondage.html comic book bondage comic book bondage

    adult bondage comics http://cartoonfox.150m.com/adult_bondage_comics.html adult bondage comics adult bondage comics

    male bondage art http://cartoonfox.150m.com/male_bondage_art.html male bondage art male bondage art

    d bondage comics http://cartoonfox.150m.com/d_bondage_comics.html d bondage comics d bondage comics

  19. 221.128.181.* 于 2007-08-01 22:35:46发表:

    art bondage http://cartoonfox.150m.com/art_bondage.html art bondage art bondage
    comic book bondage http://cartoonfox.150m.com/comic_book_bondage.html comic book bondage comic book bondage

    adult bondage comics http://cartoonfox.150m.com/adult_bondage_comics.html adult bondage comics adult bondage comics

    male bondage art http://cartoonfox.150m.com/male_bondage_art.html male bondage art male bondage art

    d bondage comics http://cartoonfox.150m.com/d_bondage_comics.html d bondage comics d bondage comics

  20. 217.150.245.* 于 2007-08-01 21:39:20发表:

    diesel ford truck used
    diesel ford truck used
    diesel ford truck used - http://www.bcars.fora.pl/

    car insurance quote
    car insurance quote
    car insurance quote - http://www.carinsurancequote.fora.pl/

  21. 202.56.7.* 于 2007-07-31 04:53:51发表:

    gmc trucks here www.gmctruck.fora.pl
    gmc from america www.gmctruck.fora.pl
    real gmc www.gmctruck.fora.pl


    and www.emeraldring.fora.pl rings

  22. 203.190.163.* 于 2007-07-30 08:57:21发表:

    emerald rings and gold rings www.emeraldring.fora.pl

  23. 201.29.218.* 于 2007-07-17 11:00:17发表:

    http://2f7c289f5060c325e849c43b7755723e-t.xkktxb.org 2f7c289f5060c325e849c43b7755723e http://2f7c289f5060c325e849c43b7755723e-b1.xkktxb.org 2f7c289f5060c325e849c43b7755723e http://2f7c289f5060c325e849c43b7755723e-b3.xkktxb.org 8d1f2bfe3cbc5359328d95464cab8b7c

  24. 216.218.252.* 于 2007-07-16 05:44:55发表:

    domination comics http://adultcomics8jul.tripod.com/domination_comics.html domination comics domination comics

    cruel comics http://adultcomics8jul.tripod.com/cruel_comics.html cruel comics cruel comics

    domination comics http://adultcomics8jul.tripod.com/domination_comics.html domination comics domination comics

    violent comics http://adultcomics8jul.tripod.com/violent_comics.html violent comics violent comics

    brutal comics http://adultcomics8jul.tripod.com/brutal_comics.html brutal comics brutal comics