1. 程式人生 > >使用者驗證-OS認證和口令認證測試

使用者驗證-OS認證和口令認證測試

驗證使用者 

驗證指的是對要使用資料、資源或應用程式的使用者、裝置或其它實體的身份進行驗證。通過對該身份進行驗證可建立一種信任關係,從而可進一步執行互動。通過驗證可將訪問和操作與特定的身份聯絡起來,從而實現可靠性。完成驗證後,驗證流程可允許或限制該實體許可的訪問和操作的級別。 

Oracle資料庫究竟使用OS認證還是口令檔案認證來進行管理取決於下面三個因素 
SQLNET.ORA引數檔案中的引數SQLNET.AUTHENTICATION_SERVICES設定
PFILE(SPFILE)引數檔案中的引數REMOTE_LOGIN_PASSWORDFILE設定擁有資料字典 
口令檔案orapw$SID(Linux) | PWD$SID.ora(Windows) 是否存SYSTEM 帳戶授予了 DBA 角色。 
Oracle許可權認證的基本順序
先由SQLNET.AUTHENTICATION_SERVICES的設定值來決定是使用OS認證還是口令檔案認證
如果使用口令檔案認證的話就要同時滿足下面兩個條件才能認證成功:
         1、REMOTE_LOGIN_PASSWORDFILE引數設定為非NONE
         2、口令檔案存在就能正常使用口令檔案認證,否則將會認證失敗

建立使用者時,必須確定要使用的驗證方法,以後可修改此方法。 
口令:又稱為 Oracle 資料庫驗證。建立的每一個使用者都有一個關聯口令,使用者嘗試建立連線時,必須提供這個口令。設定口令時,可以使該口令立即失效,這會強制使用者在首次登入後更改口令。如果決定要使使用者口令失效,請確保使用者能夠更改口令。有些應用程式不具備此功能。 
在(客戶機/伺服器之間和伺服器/伺服器之間)建立網路連線期間,系統總是先通過使用修改過的資料加密標準 (DES) 演算法,以自動透明方式對口令加密,然後通過網路傳送這些口令。

作業系統驗證:

conn / as sysdba既是作業系統認證,即使用作業系統使用者登入資料庫(root使用者不可以),該使用者必須同時新增到dba組和oinstall中,如果只新增dba組也不可以

只能用在本地 因為資料庫軟體安裝在作業系統之上

密碼檔案驗證:

口令認證:必須啟動監聽,用於網路連線,否則認證失敗。

密碼檔案儲存的位置  $ORACLE_HOME/dbs/orapw$ORACLE_SID

實驗環境:

[[email protected] ~]$ id

uid=54321(oracle) gid=54321(oinstall) groups=54321(oinstall),54322(dba)
[[email protected]tyger ~]$ sqlplus / as sysdba


SQL*Plus: Release 10.2.0.1.0 - Production on Fri Feb 28 09:15:35 2014


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




Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options


[email protected]
>select * from v$version;


BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
PL/SQL Release 10.2.0.1.0 - Production
CORE    10.2.0.1.0      Production
TNS for Linux: Version 10.2.0.1.0 - Production

NLSRTL Version 10.2.0.1.0 - Production

SQLNET.AUTHENTICATION_SERVICES引數在SQLNET.ORA(位於$ORACLE_HOME/network/admin目錄中) 檔案中對於不同的作業系統SQLNET.AUTHENTICATION_SERVICES的取值會有些不一樣,通常我們會用到下面的一些設定值:
        linux下: none  all nts 不設定或BEQ 四種情況

第一種情況:

引數SQLNET.AUTHENTICATION_SERVICES不設定或設定為BEQ---------口令認證和作業系統認證都啟動 [[email protected]tygeradmin]$ pwd
/u01/app/oracle/product/10.2.0/db_1/network/admin
[[email protected] admin]$ ls
listener.ora  samples  shrept.lst  sqlnet.ora  tnsnames.ora
[[email protected] admin]$ vim sqlnet.ora 
NAME.DIRECTORY_PATH=(tnsnames,ezconnect)


SQLNET.AUTHENTICATION_SERVICES=(BEQ)
[[email protected] admin]$ lsnrctl status


LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 28-FEB-2014 09:52:19


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


Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=tyger )(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date                28-FEB-2014 09:48:44
Uptime                    0 days 0 hr. 3 min. 34 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
Listener Log File         /u01/app/oracle/product/10.2.0/db_1/network/log/listener.log
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=tyger )(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC0)))
Services Summary...
Service "ORCL" has 1 instance(s).
  Instance "ORCL", status READY, has 1 handler(s) for this service...
Service "ORCLXDB" has 1 instance(s).
  Instance "ORCL", status READY, has 1 handler(s) for this service...
Service "ORCL_XPT" has 1 instance(s).
  Instance "ORCL", status READY, has 1 handler(s) for this service...
Service "PLSExtProc" has 1 instance(s).
  Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
[[email protected] admin]$ sqlplus / as sysdba


SQL*Plus: Release 10.2.0.1.0 - Production on Fri Feb 28 09:52:50 2014


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




Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options


[email protected]>exit    
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
[[email protected] admin]$ cd /u01/app/oracle/product/10.2.0/db_1/dbs/
[[email protected] dbs]$ ls
hc_ORCL.dat  initdw.ora  init.ora  lkORCL  orapwORCL  spfileORCL.ora
[[email protected] dbs]$ sqlplus sys/[email protected] as sysdba


SQL*Plus: Release 10.2.0.1.0 - Production on Fri Feb 28 09:53:51 2014


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




Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options


[email protected]>
第二種情況: 引數SQLNET.AUTHENTICATION_SERVICES設定為 all  -----------------------遮蔽口令認證都啟用作業系統認證

[[email protected] admin]$ pwd
/u01/app/oracle/product/10.2.0/db_1/network/admin
[[email protected] admin]$ vim sqlnet.ora 
NAME.DIRECTORY_PATH=(tnsnames,ezconnect)

SQLNET.AUTHENTICATION_SERVICES=(ALL)

[[email protected] admin]$ sqlplus / as sysdba


SQL*Plus: Release 10.2.0.1.0 - Production on Fri Feb 28 09:59:20 2014


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




Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options


[email protected]>exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
[[email protected] admin]$ sqlplus sys/[email protected] as sysdba


SQL*Plus: Release 10.2.0.1.0 - Production on Fri Feb 28 09:59:39 2014


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


ERROR:
ORA-12641: Authentication service failed to initialize




Enter user-name: 
第三種情況: 引數SQLNET.AUTHENTICATION_SERVICES 設定為  NONE 或NTS ----------------遮蔽作業系統認證都啟用口令認證 [[email protected] admin]$ vim sqlnet.ora 
NAME.DIRECTORY_PATH=(tnsnames,ezconnect)


SQLNET.AUTHENTICATION_SERVICES=(NTS)
[[email protected] admin]$ sqlplus / as sysdba


SQL*Plus: Release 10.2.0.1.0 - Production on Fri Feb 28 10:36:35 2014


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


ERROR:
ORA-01031: insufficient privileges

[[email protected] admin]$ sqlplus sys/[email protected] as sysdba


SQL*Plus: Release 10.2.0.1.0 - Production on Fri Feb 28 10:36:52 2014


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




Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options


[email protected]>
第四種情況: 當資料庫遮蔽了作業系統認證,啟用口令認證方式的話,需要檢查remote_login_passwordfile引數,如果該引數設定為NONE,該值表示不使用口令檔案,因此,此時資料庫將不能登入 解決辦法:啟動作業系統認證,登入資料庫後將remote_login_passwordfile引數修改EXCLUSIVE,然後再遮蔽作業系統認證,啟用口令認證。 > remote_login_passwordfile引數可以設定為3個值 none、exclusive、shared  [[email protected] admin]$ cat sqlnet.ora 
NAME.DIRECTORY_PATH=(tnsnames,ezconnect)


SQLNET.AUTHENTICATION_SERVICES=(NTS)
[[email protected] admin]$ sqlplus sys/[email protected] as sysdba


SQL*Plus: Release 10.2.0.1.0 - Production on Fri Feb 28 10:48:15 2014


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




Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options


[email protected]>show parameter remote


NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
remote_archive_enable                string      true
remote_dependencies_mode             string      TIMESTAMP
remote_listener                      string
remote_login_passwordfile            string      EXCLUSIVE
remote_os_authent                    boolean     FALSE
remote_os_roles                      boolean     FALSE
[email protected]>alter system set remote_login_passwordfile=none scope=spfile;


System altered.

---靜態引數,重啟資料庫生效
[email protected]>shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
[email protected]>startup
ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
[[email protected] admin]$ vim sqlnet.ora 


NAME.DIRECTORY_PATH=(tnsnames,ezconnect)


#SQLNET.AUTHENTICATION_SERVICES=(NTS)

[[email protected] admin]$ sqlplus / as sysdba


SQL*Plus: Release 10.2.0.1.0 - Production on Fri Feb 28 10:57:25 2014


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


Connected to an idle instance.


[email protected]>startup
ORACLE instance started.


Total System Global Area  285212672 bytes
Fixed Size                  1218992 bytes
Variable Size              96470608 bytes
Database Buffers          184549376 bytes
Redo Buffers                2973696 bytes
Database mounted.
Database opened.
[email protected]>show parameter remote


NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
remote_archive_enable                string      true
remote_dependencies_mode             string      TIMESTAMP
remote_listener                      string
remote_login_passwordfile            string      NONE
remote_os_authent                    boolean     FALSE
remote_os_roles                      boolean     FALSE
[email protected]>alter system set remote_login_passwordfile=exclusive scope=spfile;


System altered.
[email protected]>shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
[email protected]>startup
ORACLE instance started.


Total System Global Area  285212672 bytes
Fixed Size                  1218992 bytes
Variable Size              96470608 bytes
Database Buffers          184549376 bytes
Redo Buffers                2973696 bytes
Database mounted.
Database opened.
[email protected]>show parameter remote


NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
remote_archive_enable                string      true
remote_dependencies_mode             string      TIMESTAMP
remote_listener                      string
remote_login_passwordfile            string      EXCLUSIVE
remote_os_authent                    boolean     FALSE
remote_os_roles                      boolean     FALSE
[email protected]>exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
[[email protected] admin]$ sqlplus sys/[email protected] as sysdba


SQL*Plus: Release 10.2.0.1.0 - Production on Fri Feb 28 11:04:16 2014


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




Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options


[email protected]>

相關推薦

使用者驗證-OS認證口令認證測試

驗證使用者  驗證指的是對要使用資料、資源或應用程式的使用者、裝置或其它實體的身份進行驗證。通過對該身份進行驗證可建立一種信任關係,從而可進一步執行互動。通過驗證可將訪問和操作與特定的身份聯絡起來,從而實現可靠性。完成驗證後,驗證流程可允許或限制該實體許可的訪問和操作的級別

ppp CHAP認證PAP認證

challenge upload chap unity pass 推薦 查找 class 用戶密碼 CHAP認證過程: 、 CHAP單向驗證過程分為兩種情況:驗證方配置了用戶名和驗證方沒有配置用戶名。推薦使用驗證方配置用戶名的方式,這樣可以對驗證方的用戶名進行確認。

HTTPS 單向認證雙向認證

一、HTTP HyperText Transfer Protocol ,超文字傳輸協議,是網際網路上使用最廣泛的一種協議,所有WWW檔案必須遵循的標準。HTTP協議傳輸的資料都是未加密的,也就是明文的,因此使用HTTP協議傳輸隱私資訊非常不安全。 使用TCP埠為:80

乾貨 | 圖解 https 單向認證雙向認證

一、Http HyperText Transfer Protocol,超文字傳輸協議,是網際網路上使用最廣泛的一種協議,所有WWW檔案必須遵循的標準。HTTP協議傳輸的資料都是未加密的,也就是明文的,因此使用HTTP協議傳輸隱私資訊非常不安全。 使用TCP埠為:80

https單向認證雙向認證

一、Http HyperText Transfer Protocol,超文字傳輸協議,是網際網路上使用最廣泛的一種協議,所有WWW檔案必須遵循的標準。HTTP協議傳輸的資料都是未加密的,也就是明文的,因此使用HTTP協議傳輸隱私資訊非常不安全。 使用TCP埠為:80

關於basic認證digest認證的初步理解

1.  basic認證是把使用者和密碼通過base64加密後傳送給伺服器進行驗證 2.  digest認證則是把伺服器響應的401訊息裡面的特定的值和使用者名稱以及密碼結合起來進行不可逆的摘要演算法運算得到一個值,然後把使用者名稱和這個摘要值發給伺服器,服務通過使用者名稱去

SpringBoot學習:整合shiro(身份認證許可權認證),使用EhCache快取

專案下載地址:http://download.csdn.NET/detail/aqsunkai/9805821 (一)在pom.xml中新增依賴: <properties> <shiro.version>1.3.2</shiro.ve

tomcat------https單向認證雙向認證

 一、https分為單向認證和雙向認證: 單向認證就是說,只有客戶端使用ssl時對伺服器端的證書進行認證,也就是說,客戶端在請求建立之前,伺服器端會向客戶端傳送一個證書,一般情況下,這種證書都是由自己或企業自行釋出的,所以在客戶端使用https時,會跳出“是否信任並

spring boot配置Https單向認證雙向認證

Spring boot SSL配置部分文件:   這裡將server.pfx、trustore.p12拷貝到了src/main/resources/路徑下 單向認證: server.port: 8443 server.ssl.key-store: src/

Darwin拉流支援基本認證摘要認證

RTSP認證作為RTSP標準協議的一部分,其內容在網上可以找到很多,在此就不在贅述。EasyDarwin作為RTSP伺服器也提供了對RTSP請求的基本認證和摘要認證。 EasyDarwin用RTSPSession物件來處理RTSP請求,在其Run函式的kAuthentica

乾貨 | 圖解 https 單向認證雙向認證

一、Http HyperText Transfer Protocol,超文字傳輸協議,是網際網路上使用最廣泛的一種協議,所有W

app與php後臺介面登入認證驗證(seesiontoken)

簡要:隨著電商的不斷髮展,APP也層次不窮,隨著科技的發展主要登入形式(微信、QQ、賬號/密碼);為此向大家分享一下"app與php後臺介面登入認證、驗證"想法和做法;希望能夠幫助困惑的夥伴們,如果有不對或者好的建議告知下;*~*!一、登入機制粗略分析:登入可分為三個階段(登

TL認證運作經典案例評選

部門 研發 性問題 文化 案例 成功 推廣 推出 評選 評選背景: 1、TL能力模型推出一年多時間以來,各地區、部門的TL認證和運作如火如荼,中開社上已有部分案例輸出; 2、有部門在認證和運作上希望能借鑒優秀案例的經驗

【Spring-Security】【1】認證授權

部分 完整 業務 代碼 參數 web 用戶訪問 設置 管理權限 【認證】 憑據為基礎的認證: 當你登錄 e-mail 賬號時,你可能提供你的用戶名和密碼。E-mail的提供商會將你的用戶名與數據中的記錄進行匹配,並驗證你提供的密碼與對應的記錄是不是匹配。這些憑證(用戶名和

Linux ssh服務開啟秘鑰密碼認證

authent 列表 scom via con x11 ati cit ren 問題描述: 實現Linux秘鑰和密碼同時認證 解決方案: vim /etc/ssh/sshd_config 基本參數: PermitRootLogin yes #允許r

BOS項目 第7天(shiro權限框架進行認證授權)

ebs setattr not action 錯誤信息 add 流程圖 元素 錯誤提示 BOS項目筆記 第7天 今天內容安排: 1、權限概述(認證、授權) 2、常見的權限控制的方式(URL攔截權限控制、方法註解權限控制) 3、權限數據模型(權限表、角色表、用戶表、角色權

《Spring Cloud Netflix》-- 服務註冊服務發現-Eureka的服務認證集群

cluster word self. app server 同步 not eat wal 一、 Eureka的服務認證 1、 服務端添加依賴 <dependency> <groupId>org.springframework.boot&

spring security oauth2 jwt 認證資源分離的配置文件(java類配置版)

boot cond lan 資源分離 測試 sql adapter 依賴 註入 最近再學習spring security oauth2。下載了官方的例子sparklr2和tonr2進行學習。但是例子裏包含的東西太多,不知道最簡單最主要的配置有哪些。所以決定自己嘗試搭建簡單版

OAuth2.0認證授權原理

avi b2c 用戶授權 服務商 包括 facebook 自己的 borde 技術分享 什麽是OAuth授權? 一、什麽是OAuth協議 OAuth(開放授權)是一個開放標準。 允許第三方網站在用戶授權的前提下訪問在用戶在服務商那裏存儲的各種信息。 而這種授權無需將用

Yii2框架RESTful API教程(二) - 格式化響應,授權認證速率限制

formatter loginurl 而不是 filters ica cat 表示 程序 ssi 之前寫過一篇Yii2框架RESTful API教程(一) - 快速入門,今天接著來探究一下Yii2 RESTful的格式化響應,授權認證和速率限制三個部分 一、目錄結構 先