使用sql*plus时的一个安全小问题

在unix环境下,当你使用sql*plus访问数据库时,说不定不知不觉间就把数据库的用户名和口令告诉给了其他操作系统用户。不妨做以下试验。[@more@]

telnet到数据库服务器,用如下命令启动sql*plus:

/export/home/deverdb>sqlplus system/sysmg3r4@suppfrwi

SQL*Plus: Release 8.1.7.0.0 - Production on Wed Jun 22 13:10:48 2005

(c) Copyright 2000 Oracle Corporation. All rights reserved.

Connecte a :
Oracle8i Enterprise Edition Release 8.1.7.4.0 - Production
With the Partitioning option
JServer Release 8.1.7.4.0 - Production

SQL>......

在另外telnet窗口中,运行命令:

export/home/deverdb>ps -ef|grep sqlplus

deverdb 26475 13858 0 13:10:48 pts/3 0:00 sqlplus system/sysmg3r4@suppfrwi
oracle 7139 1 0 22:00:01 ? 0:00 sqlplus SYSTEM/SYSMG3R4

命令结果清楚地显示了连接数据库的用户名,口令和连接串。

==============================================================

为了避免上述情况,建议在数据库服务器上用sql*plus访问数据库时,用如下命令:

/export/home/deverdb>sqlplus /nolog

SQL*Plus: Release 8.1.7.0.0 - Production on Wed Jun 22 13:18:45 2005

(c) Copyright 2000 Oracle Corporation. All rights reserved.

SQL> connect system/sysmg3r4@suppfrwi

Connecte.

再运行ps -ef|grep sqlplus命令,得到结果如下:

export/home/deverdb>ps -ef|grep sqlplus

oracle 7139 1 0 22:00:01 ? 0:00 sqlplus SYSTEM/SYSMG3R4
deverdb 26904 13858 0 13:18:44 pts/3 0:00 sqlplus /nolog

另外,创建一个带有用户名和口令的文件,然后将这个文件管道传递给sql*plus,也可以避免密码泄漏。在用此方法时,注意将文件的权限设置为700

请使用浏览器的分享功能分享到微信等