Oracle OS authentication password file and password loss

Source: Internet
Author: User

I. OS Authentication

1.1 Introduction to OS Authentication

After Oracle is installed, OS authentication is enabled by default. The OS authentication mentioned here refers to the server-side OS authentication. OS authentication means that the user and password for database login are verified at the operating system level. If you log on to the OS when installing Oracle, no authentication is required when you log on to the Oracle database, for example:

SQL> connect/as sysdba

Connected.

SQL> connect sys/aaa @ test as sysdba

Connected.

SQL> connect sys/bbb as sysdba

Connected.

SQL> connect aaa/bbb as sysdba

Connected.

SQL> show user

SYS

SQL>

No matter which user you enter (even if this user, such as aaa, does not exist in the Database), you can connect to the database as long as you connect to the database with the sysdba permission and the user is sys, which is very convenient, sometimes, if you forget the Database Password and want to log on to the database, you can use this method on the database server.

1.2 OS Authentication-related parameters

Oracle Database performs OS authentication using the following three parameters:

(1) sqlnet. AUTHENTICATION_SERVICES parameter in SQLNET. ora.

(2) The REMOTE_LOGIN_PASSWORDFILE parameter in the PFILE (or SPFILE) File

(3) password file PWDsid. ora (windows) or orapwSID (linux, case sensitive ).

1.2.1 sqlnet. ora file Parameters

File Location: $ ORACLE_HOME/network/admin/sqlnet. ora

SQLNET. AUTHENTICATION_SERVICES = (CNT)

NAMES. DIRECTORY_PATH = (TNSNAMES, EZCONNECT)

Parameters can have the following values:

SQLNET. AUTHENTICATION_SERVICES = (CNT) | (NONE)

Where:

(ETS): indicates the operating system authentication method. password files are not used. The default value is.

(NONE): Password File authentication method

1.2.2 REMOTE_LOGIN_PASSWORDFILE Parameter

This parameter can have the following values:

REMOTE_LOGIN_PASSWORDFILE = 'none' | 'clusive '| 'shared'

(1) NONE: Do not use the password file to log on, remote users are not allowed to log on to the system using sys, and sys passwords can be modified online;

(2) EXCLUSIVE: default value. Only one database can use this password file, allow remote login, allow non-sys users to manage the database as sysdba, and change the sys password online. In this mode, the password file can contain passwords for multiple licensed Oracle accounts. This is the recommended operation mode, especially when running RMAN. If you want to connect RMAN to a database from a remote client, you must use this parameter.

(3) SHARE: password files can be used for multiple databases. In fact, when the Oracle database is started, it first looks for the password file of orapw <sid>. If the file does not exist, it starts searching, if the password file of orapw is named orapw, multiple databases can share the file, allow remote logon, manage sysdba only with sys, and change the password of sys online. In this setting, only the INTERNAL/SYS account can be identified. Even if the file contains information of other users, they are not allowed to log on with SYSOPER/SYSDBA.

Modify:

SQL> ALTER SYSTEM SET REMOTE_LOGIN_PASSWORDFILE = EXCLUSIVE SCOPE = SPFILE;

Note that this parameter is not a dynamic parameter. You need to modify the modification when the database is loaded to the MOUNT state, and restart the database after the change, so that the parameter settings can take effect.

1.3 disable OS Authentication

OS authentication has certain security risks. We can block OS authentication.

1.3.1 in windows

In win, you only need to set oracle_home/NETWORK/admin/sqlnet. SQLNET. AUTHENTICATION_SERVICES = (CNT) the system should be set to none or comment out this sentence (add # above) to block the OS function. to connect a sys user to a database, you must enter the correct sys password, you can also delete the oracle installer from the ora_dba group. Of course, you can also delete the ora_dba group directly to disable the OS function.

For example:

SQL> connect/as sysdba

ERROR:

ORA-01031: insufficient Permissions

SQL> connect sys/aaa as sysdba

ERROR:

ORA-01017: invalid username/password; login denied

SQL> connect aaa/bbb as sysdba

ERROR:

ORA-01031: insufficient Permissions

SQL> connect sys/system as sysdba

Connected.

SQL>

1.3.2 LINUX/UNIX

Adding sqlnet. AUTHENTICATION_SERVICES = (none) to the file SQLNET. ora and deleting dba (groupdel dba) groups or removing oracle users from the dba group can shield OS authentication.

Note:

With this blocking method, the system administrator can still create an ora_dba or dba group and modify the sqlnet. ora file.

  • 1
  • 2
  • Next Page

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.