How can I connect to Oracle Database 11g server through ssh tunnel chain (double tunnel, server in company network)?(如何通过 ssh 隧道链(双隧道,公司网络中的服务器)连接到 Oracle Database 11g 服务器?)
问题描述
我可以通过 SSH 访问公共"服务器,这也是通往公司网络的网关.网络中有另一台服务器,本地 Oracle 数据库服务器正在运行(没有来自该服务器外部的访问,只接受本地主机数据库连接).当然,我还有另一个 SSH 访问此服务器的权限.
I have SSH access to 'public' server, which is also the gateway to company network. There is another server in the network, where local Oracle Database server is running (There is no access from outside of this server, only localhost DB connections are accepted). And of course, I have another SSH access to this server.
有没有办法从网络外部加入这个 Oracle Database 11g 服务器?我在问是否有类似 ssh 隧道链的东西,以及我如何配置它.例如,这对于 TOAD for Oracle(ORACLE 客户端)很有用.
Is there any way to join to this Oracle Database 11g Server from outside of the network ? I am asking if there is something like ssh tunnel chain, and how i configure it. This can be usefull, for example, for TOAD for Oracle (ORACLE client).
这是图片
谢谢
推荐答案
是的,这是可能的.例如.在 Linux 上,运行
Yes, it's possible. E.g. on Linux, run
ssh -N -Llocalport:dbserver:dbport yourname@connectionserver
哪里
- localport 是你机器上将被转发的端口(如果没有运行oracle的本地实例,可以是1521)
- dbserver 是数据库服务器的名称或 IP
- dbport 是数据库的端口(通常是 1521)
- 你的名字是连接服务器上的登录名
- connectionserver 是您具有 ssh 访问权限的机器
同样可以在 Windows 上使用 Plink(Putty 附带)来完成:
The same can be done on Windows using Plink (which comes with Putty):
plink -N -L localport:dbserver:dbport yourname@connectionserver
在两台机器(您的本地机器和您有权访问的服务器)上执行此操作以链接 ssh 隧道.示例:
Do this on both machines (your local machine and the server you have access to) to chain the ssh tunnels. Example:
连接服务器(假设为 Linux):
Connection server (assuming Linux):
ssh -N -L1521:dbserver:1521 dblogin@dbserver
您的电脑:
plink -N -L 1521:connectionserver:1521 connlogin@connectionserver
tnsnames.ora 条目必须看起来像您正在运行本地数据库,例如
The tnsnames.ora entry must look like you are running a local database, e.g.
prodoverssh =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = prod)
)
)
这篇关于如何通过 ssh 隧道链(双隧道,公司网络中的服务器)连接到 Oracle Database 11g 服务器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何通过 ssh 隧道链(双隧道,公司网络中的服务器)连接到 Oracle Database 11g 服务器?
基础教程推荐
- SSMS 中的权限问题:“对象 'extended_properties'、数据库 'mssqlsystem_resource'、... 错误 229)上的 SELECT 权限被拒绝" 2022-01-01
- 如何使用 mysql.connector 禁用查询缓存 2022-01-01
- 将 SQL Server DateTime 列迁移到 DateTimeOffset 2021-01-01
- 无法解决整理冲突 2021-01-01
- 是否可以执行按位分组功能? 2021-01-01
- 在 SQL 中连接多个表 2021-01-01
- 需要 MySQL 5.1 中的抽象触发器来更新审计日志 2021-01-01
- SQL:使用来自具有相同列名的两个表中的数据... 2021-01-01
- SQL Server 实例在登录协商期间返回无效或不受支持的协议版本 2021-01-01
- SQL 效率:WHERE IN 子查询 vs. JOIN 然后 GROUP 2021-01-01
