[Oracle] 오라클 인증방법 3가지

·2025년 9월 3일
0

오라클 관리

목록 보기
81/163


[이론1] 오라클 인증방법 3가지

  1. password 인증방법 : 일반적인 보통의 인증방법
  2. external 인증방법 : 가벼운 인증방법 (패스워드 없이 가능)
  3. global 인증방법 : 가장 엄격한 인증방법

[실습1] password 인증방법 실습

create user james
identified by tiger;

grant connect to james;

select username, password
 from dba_users;

[실습2] scott의 패스워드를 oracle1234로 변경하시오

alter user scott
 identified by oracle1234;

ㄴ 바람직하지 않은 방법

💡 패스워드를 변경할 때 해커들이 해킹하지 못하도록 엄격하게 변경해야함
특히 특수문자를 넣으면 해커들이 해킹할 때 암호를 알아내야 할 조합이 많아져서 해킹이 어려워진다고 함


⭐ [실습3] sys 유져로 접속할 때 다음과 같이 접속되지 못하게 막으시오

[oracle@ora19c ~]$ sqlplus "/as sysdba"

SQL*Plus: Release 19.0.0.0.0 - Production on93 10:55:11 2025
Version 19.3.0.0.0

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


다음에 접속됨:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0

SYS @ ORA19 > alter user scott identified by tiger;

사용자가 변경되었습니다.

sqlnet.ora 에 아래의 내용을 추가하시오

# 기존 OS 인증 설정 비활성화
# SQLNET.AUTHENTICATION_SERVICES=(NTS) 주석 처리 또는 삭제

# OS 인증 완전 비활성화
SQLNET.AUTHENTICATION_SERVICES=NONE

# 또는 TCP만 허용
SQLNET.AUTHENTICATION_SERVICES=(TCPS)

[oracle@ora19c ~]$ net
[oracle@ora19c admin]$
[oracle@ora19c admin]$ ls
listener.ora           listener_shared.ora  samples     sqlnet.ora
listener.ora.20250821  listener_static.ora  shrept.lst  tnsnames.ora
[oracle@ora19c admin]$
[oracle@ora19c admin]$ vi sqlnet.ora
[oracle@ora19c admin]$
[oracle@ora19c admin]$ sqlplus "/as sysdba"

SQL*Plus: Release 19.0.0.0.0 - Production on93 11:00:30 2025
Version 19.3.0.0.0

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

ERROR:
ORA-01017: 사용자명/비밀번호가 부적합, 로그온할 수 없습니다.


사용자명 입력:


[oracle@ora19c admin]$ sqlplus sys/oracle_4U as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on93 11:01:02 2025
Version 19.3.0.0.0

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

마지막 성공한 로그인 시간: 수 903 2025 09:28:49 +09:00

다음에 접속됨:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0

SYS @ ORA19 >
[oracle@ora19c admin]$ cd

[oracle@ora19c] vi .bash_profile

alias sys='export ORACLE_SID=ORA19; sqlplus sys/oracle_4U as sysdba'
alias sysdw='export ORACLE_SID=ora19dw; sqlplus sys/oracle_4U as sysdba'

[실습4] external 인증방법을 설정하시오

💡 패스워드 없이 가볍게 접속하고 권한도 최소화한 db유져를 생성하고 싶을 때 또는 guest 계정을 생성하고 싶을 때 external 인증방법을 쓰면 됨


#1. 리눅스 os 에서 접속한 os 의 유져를 확인합니다.

$ whoami
oracle

#2. sys 유져로 접속해서 os_authent_prefix 파라미터값을 확인합니다. 

PROD> show parameter authent

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
os_authent_prefix                    string      ops$

#3. 손님 계정을 생성합니다. 

PROD> create  user  ops$oracle
       identified  externally; 

#4. 손님계정에게 접속할 수 있는 권한을 부여합니다.

PROD> grant  connect  to  ops$oracle;

#5.  os 로 빠져나갔다가 다시 접속하는데 아래와 같이 접속해보시오

$ sqlplus   /               

PROD> show user
USER is "OPS$ORACLE"


**external 인증 방법**이란
리눅스 os에 접속했으면 그 다음에 oracle에 접속할 때는
유져이름과 패스워드 없이 접속하게 하는 인증방법 입니다. 

0개의 댓글