[20170111]设置无需口令登录数据库.txt

[20170111]设置无需口令登录数据库.txt

--以前链接提到的http://blog.itpub.net/267265/viewspace-2124815/,必须考虑一种方式登录避免口令的暴露。
--想到设置Oracle Wallets,自己从来没有做过,测试看看。

1.环境:
SCOTT@book> @ &r/ver1

PORT_STRING                    VERSION        BANNER
------------------------------ -------------- --------------------------------------------------------------------------------
x86_64/Linux 2.4.xx            11.2.0.4.0     Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

2.建立wallets:
$ mkdir /u01/app/oracle/admin/wallets
$ mkstore -wrl /u01/app/oracle11g/admin/wallet -create
--//注意输入密码要复杂一点点,不然提示出错,另外以后必须记住此密码,便于管理wallets。
PKI-01002: Invalid password:Passwords must have a minimum length of eight characters and contain alphabetic characters
combined with numbers or special characters

$ mkstore -wrl /u01/app/oracle/admin/wallets -createCredential book SYS oracle

$ mkstore -wrl /u01/app/oracle/admin/wallets -createCredential book SYS oracle
Oracle Secret Store Tool : Version 11.2.0.4.0 - Production
Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
Enter wallet password:
Create credential oracle.security.client.connect_string1

--参数createCredential的格式如下,可以看帮助:
[-createCredential connect_string username password]

3.修改sqlnet.ora文件,加入:

WALLET_LOCATION =
   (SOURCE =
      (METHOD = FILE)
      (METHOD_DATA = (DIRECTORY = /u01/app/oracle/admin/wallets))
)

SQLNET.WALLET_OVERRIDE=true

--//注:我的测试必须需要后面1行,否者无法通过。

4.测试:
$ sqlplus /@book as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Wed Jan 11 09:25:33 2017
Copyright (c) 1982, 2013, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SYS@book> show user
USER is "SYS"

--//使用rman测试:
$ rman target /@book
Recovery Manager: Release 11.2.0.4.0 - Production on Wed Jan 11 09:39:58 2017
Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.
connected to target database: BOOK (DBID=1337401710)
RMAN>

5.相关命令学习:
$ mkstore -wrl  /u01/app/oracle/admin/wallets -list
Oracle Secret Store Tool : Version 11.2.0.4.0 - Production
Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
Enter wallet password:
Oracle Secret Store entries:
oracle.security.client.connect_string1
oracle.security.client.password1
oracle.security.client.username1

--不知道什么意思。
$ mkstore -wrl  /u01/app/oracle/admin/wallets  -viewEntry oracle.security.client.password1
Oracle Secret Store Tool : Version 11.2.0.4.0 - Production
Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
Enter wallet password:
oracle.security.client.password1 = oracle

$  mkstore -wrl  /u01/app/oracle/admin/wallets -listCredential
Oracle Secret Store Tool : Version 11.2.0.4.0 - Production
Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.

Enter wallet password:

List credential (index: connect_string username)
1: book SYS

$ mkstore -wrl  /u01/app/oracle/admin/wallets  -viewEntry oracle.security.client.password1
Oracle Secret Store Tool : Version 11.2.0.4.0 - Production
Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
Enter wallet password:
oracle.security.client.password1 = oracle

--//可以发现密码,还可以增加项目,比如我在tnsnames.ora建立连接串:78S

$ mkstore -wrl /u01/app/oracle/admin/wallets -createCredential 78S scott book
Oracle Secret Store Tool : Version 11.2.0.4.0 - Production
Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
Enter wallet password:
Create credential oracle.security.client.connect_string2

$  mkstore -wrl  /u01/app/oracle/admin/wallets -listCredential
Oracle Secret Store Tool : Version 11.2.0.4.0 - Production
Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
Enter wallet password:
List credential (index: connect_string username)
2: 78S scott
1: book SYS

$ sqlplus /@78s
SQL*Plus: Release 11.2.0.4.0 Production on Wed Jan 11 09:35:43 2017
Copyright (c) 1982, 2013, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SCOTT@78s> show user
USER is "SCOTT"
--//登录的是scott用户。

--//删除1项
$  mkstore -wrl  /u01/app/oracle/admin/wallets -deleteCredential 78S
Oracle Secret Store Tool : Version 11.2.0.4.0 - Production
Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
Enter wallet password:
Delete credential
Delete 2

--但是你不能再建立这样的项,提示存在:
$ mkstore -wrl /u01/app/oracle/admin/wallets -createCredential book scott book
Oracle Secret Store Tool : Version 11.2.0.4.0 - Production
Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
Enter wallet password:
Create credential Secret Store error occured: oracle.security.pki.OracleSecretStoreException: Credential already exists

时间: 2024-07-30 10:49:13

[20170111]设置无需口令登录数据库.txt的相关文章

[20170111]设置无需口令登录数据库2.txt

[20170111]设置无需口令登录数据库2.txt --//上午测试无需口令登录数据库,这样连接数据库使用sqlplus /@book ,这样实际上通过网络连接数据库,哪怕是在本机也是这样. --//思考一下是否绕过. --//前面测试链接:http://blog.itpub.net/267265/viewspace-2132220/ 1.环境: SCOTT@book> @ &r/ver1 PORT_STRING                    VERSION        BANN

SSH 使用密钥登录并禁止口令登录实践

前言 无论是个人的VPS还是企业允许公网访问的服务器,如果开放22端口的SSH密码登录验证方式,被众多黑客暴力猜解捅破菊花也可能是经常发生的惨剧.企业可以通过防火墙来做限制,普通用户也可能借助修改22端口和强化弱口令等方式防护,但目前相对安全和简单的方案则是让SSH使用密钥登录并禁止口令登录. 这是最相对安全的登录管理方式 生成PublicKey 建议设置并牢记passphrase密码短语,以Linux生成为例 Linux:ssh-keygen -t rsa [私钥 (id_rsa) 与公钥 (

[20120810]linux使用syslog审计数据库.txt

[20120810]linux使用syslog审计数据库.txt linux下使用syslog记录系统的日志,是否可以使用它来记录oracle的一些日志呢?今天看了一些文档,尝试看看. SQL> select * from v$version ; BANNER -------------------------------------------------------------------------------- Oracle Database 11g Enterprise Edition

vs2010用水晶报表DataSet数据源打印,登录数据库,急的不知道咋办了

问题描述 用vs2010,使用的水晶报表DataSet数据源打印创建了DataSet,并且手工添加了数据表,创建水晶报表,选择DataSet的表为数据源,本机调试运行没问题,发布安装后,提示要登录数据库DataTabledt_print=newDataTable();DataColumndc1=newDataColumn("khmc",Type.GetType("System.String"));DataColumndc2=newDataColumn("a

sqlplus连接登录数据库时,出现 ORA-28009错误(转)

安装了oracle10g,打算用SQLPLUS 登录数据库进行操作.打开sqlplus后,可以看到要求输入用户名,口令和主机字符串.前面两个都知道,但是后一个却不明白,查了资料才知道是安装时的全局数据库名,也就是SID,知道了这点后,我用sys登录,输入用户名,口令和主机字符串登录,但却出错.错误如下 ERROR: ORA-28009:connection as SYS should be as SYSDBA or SYSOPER. 它的意思是我登录的用户名sys应该是数据库管理员,所以要用数据

php 用户注册并且设置为己登录状态实现方法

php教程 用户注册并且设置为己登录状态实现方法,下面实例讲述了如何把表单提交的数据保存到mysql教程数据库教程,而没有实现用户注册后自动登录的功能,而实例二就实现了这种做法. <html> <body> <?php $self = $_SERVER['PHP_SELF']; $firstname = $_POST['firstname']; $lastname = $_POST['lastname']; $username = $_POST['username']; $p

[20151124]快速建立测试数据库.txt

[20151124]快速建立测试数据库.txt -- 以建立11.2.0.4的数据库为例子说明,以前写过使用内存来运行测试数据库,以这个为基础并且做一个记录. -- 重新删除在建立数据库. startup nomount; alter system enable restricted session; RMAN> drop database including backups; 1.建立内存盘: # mkdir -p /mnt/ramdisk # mount -t tmpfs -o size=8

Windows7怎样设置自动快速登录

Windows7怎样设置自动快速登录?下面小编将这一WIN7系统应用的小技巧分享给大家,目前已经有很多用户正在使用微软发布的Windows 7版本操作系统,而Windows 7系统中很多隐藏的小秘密也正一点点被人们所发掘出来.Windows操作系统有一个软肋总是被人们提及,那就是它的启动速度过慢,如今的Windows 7就有所改善了. 如果你想加快Windows 7系统的启动速度,可以对设置进行更改后让它自动为用户登录.当然这种方式最好仅在自己的个人电脑上使用为好,若不然可能会涉及到个人隐私和安

Windows7怎样设置自动快速登录?

  Windows7怎样设置自动快速登录?下面小编将这一WIN7系统应用的小技巧分享给大家,目前已经有很多用户正在使用微软发布的Windows 7版本操作系统,而Windows 7系统中很多隐藏的小秘密也正一点点被人们所发掘出来.Windows操作系统有一个软肋总是被人们提及,那就是它的启动速度过慢,如今的Windows 7就有所改善了. 如果你想加快Windows 7系统的启动速度,可以对设置进行更改后让它自动为用户登录.当然这种方式最好仅在自己的个人电脑上使用为好,若不然可能会涉及到个人隐私