TNS connection forwardWhich local port does MySQL Workbench forward to in 'Standard TCP/IP over SSH'...
Why did Tywin never remarry?
I'm struggling to say 'struggle'
GPL - Is it required to post source code to the Public - when is a software released?
Do error bars on probabilities have any meaning?
How to not forget my phone in the bathroom?
Are there any rules or guidelines about the order of saving throws?
multiple price sets?
Would life expectancy increase if we replaced healthy organs with artificial ones?
Simple Question About Conservation of Angular Momentum
Why does RAM (any type) access time decrease so slowly?
Why do climate experts from the UN/IPCC rarely mention Grand Solar Minimum?
Badly designed reimbursement form. What does that say about the company?
I hate taking lectures, can I still survive in academia?
Discouraging missile alpha strikes
Why does Python copy numpy arrays where the length of the dimensions are the same?
How can guns be countered by melee combat without raw-ability or exceptional explanations?
How to play song that contains one guitar when we have two guitarists (or more)?
Prove that a cyclic group with only one generator can have at most 2 elements
How to make clear what a part-humanoid character looks like when they're quite common in their world?
Is there a technology capable of disabling the whole of Earth's satellitle network?
Coworker is trying to get me to sign his petition to run for office. How to decline politely?
Does the phrase がんばする makes sense?
Apparently I’m calling random numbers but nothing in call log?
Why is Shelob considered evil?
TNS connection forward
Which local port does MySQL Workbench forward to in 'Standard TCP/IP over SSH' connections?How to connect to remote MySQL server with sshuser and mysqluser being distinctMySQL workbench: Cannot Connect to Database Server (ssh)Issues with SQL DeveloperUnable to remote access MySQL - UnbuntuWindows to DB2 Connection: Connection authorization failure occurred. Reason: Local security service non-retryable errorTNS Time out Error ORA-12170Can I restore a .bmp file of full database backup to an Oracle 12c EE instance running on RDS?Oracle 12c connection configuration errorspgAdmin 4: How to establish a connection through an SSH tunnel/interface in Windows
There are 3 machines as follows:
Machine A - Remote Exadata DB machine
Machine B - Remote machine from which only I can connect to port 1521 of Machine A
Machine C - Local Machine (To run SQL Developer and can't connect machineA directly)
Machine D - Bastion Server through which I connect to Machine B
Machine C can access service running in Machine B only using SSH tunnelling.
Is there any way I can access the Exadata DB from Machine A using SQL Developer running in Machine C?
I am trying this way:
ssh MachineD -L 15219:MachineB:15220 -L 15220:MachineA:1521
which is not working.
linux oracle-12c remote sysdba ssh
bumped to the homepage by Community♦ 11 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
There are 3 machines as follows:
Machine A - Remote Exadata DB machine
Machine B - Remote machine from which only I can connect to port 1521 of Machine A
Machine C - Local Machine (To run SQL Developer and can't connect machineA directly)
Machine D - Bastion Server through which I connect to Machine B
Machine C can access service running in Machine B only using SSH tunnelling.
Is there any way I can access the Exadata DB from Machine A using SQL Developer running in Machine C?
I am trying this way:
ssh MachineD -L 15219:MachineB:15220 -L 15220:MachineA:1521
which is not working.
linux oracle-12c remote sysdba ssh
bumped to the homepage by Community♦ 11 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
how do you connect ti the exadata at the moment. Using sqlplus from machine B? If so, how do you connect to machine B?
– miracle173
Jan 31 '18 at 8:31
@miracle173 yes , using sqlplus from machineB, From MachineC I use this: ssh MachineD -W MachineB:22 to login
– kumarprd
Feb 1 '18 at 11:00
did my solution work?
– miracle173
Feb 7 '18 at 3:23
@miracle173, thank you for the detailed solution. Actually I am seeing some firewall issue, where connection is getting refused while accessing the port after creating the tunnel.
– kumarprd
Feb 12 '18 at 15:29
add a comment |
There are 3 machines as follows:
Machine A - Remote Exadata DB machine
Machine B - Remote machine from which only I can connect to port 1521 of Machine A
Machine C - Local Machine (To run SQL Developer and can't connect machineA directly)
Machine D - Bastion Server through which I connect to Machine B
Machine C can access service running in Machine B only using SSH tunnelling.
Is there any way I can access the Exadata DB from Machine A using SQL Developer running in Machine C?
I am trying this way:
ssh MachineD -L 15219:MachineB:15220 -L 15220:MachineA:1521
which is not working.
linux oracle-12c remote sysdba ssh
There are 3 machines as follows:
Machine A - Remote Exadata DB machine
Machine B - Remote machine from which only I can connect to port 1521 of Machine A
Machine C - Local Machine (To run SQL Developer and can't connect machineA directly)
Machine D - Bastion Server through which I connect to Machine B
Machine C can access service running in Machine B only using SSH tunnelling.
Is there any way I can access the Exadata DB from Machine A using SQL Developer running in Machine C?
I am trying this way:
ssh MachineD -L 15219:MachineB:15220 -L 15220:MachineA:1521
which is not working.
linux oracle-12c remote sysdba ssh
linux oracle-12c remote sysdba ssh
edited Jan 31 '18 at 8:34
miracle173
6,5271837
6,5271837
asked Jan 30 '18 at 12:11
kumarprdkumarprd
1045
1045
bumped to the homepage by Community♦ 11 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
bumped to the homepage by Community♦ 11 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
how do you connect ti the exadata at the moment. Using sqlplus from machine B? If so, how do you connect to machine B?
– miracle173
Jan 31 '18 at 8:31
@miracle173 yes , using sqlplus from machineB, From MachineC I use this: ssh MachineD -W MachineB:22 to login
– kumarprd
Feb 1 '18 at 11:00
did my solution work?
– miracle173
Feb 7 '18 at 3:23
@miracle173, thank you for the detailed solution. Actually I am seeing some firewall issue, where connection is getting refused while accessing the port after creating the tunnel.
– kumarprd
Feb 12 '18 at 15:29
add a comment |
how do you connect ti the exadata at the moment. Using sqlplus from machine B? If so, how do you connect to machine B?
– miracle173
Jan 31 '18 at 8:31
@miracle173 yes , using sqlplus from machineB, From MachineC I use this: ssh MachineD -W MachineB:22 to login
– kumarprd
Feb 1 '18 at 11:00
did my solution work?
– miracle173
Feb 7 '18 at 3:23
@miracle173, thank you for the detailed solution. Actually I am seeing some firewall issue, where connection is getting refused while accessing the port after creating the tunnel.
– kumarprd
Feb 12 '18 at 15:29
how do you connect ti the exadata at the moment. Using sqlplus from machine B? If so, how do you connect to machine B?
– miracle173
Jan 31 '18 at 8:31
how do you connect ti the exadata at the moment. Using sqlplus from machine B? If so, how do you connect to machine B?
– miracle173
Jan 31 '18 at 8:31
@miracle173 yes , using sqlplus from machineB, From MachineC I use this: ssh MachineD -W MachineB:22 to login
– kumarprd
Feb 1 '18 at 11:00
@miracle173 yes , using sqlplus from machineB, From MachineC I use this: ssh MachineD -W MachineB:22 to login
– kumarprd
Feb 1 '18 at 11:00
did my solution work?
– miracle173
Feb 7 '18 at 3:23
did my solution work?
– miracle173
Feb 7 '18 at 3:23
@miracle173, thank you for the detailed solution. Actually I am seeing some firewall issue, where connection is getting refused while accessing the port after creating the tunnel.
– kumarprd
Feb 12 '18 at 15:29
@miracle173, thank you for the detailed solution. Actually I am seeing some firewall issue, where connection is getting refused while accessing the port after creating the tunnel.
– kumarprd
Feb 12 '18 at 15:29
add a comment |
2 Answers
2
active
oldest
votes
You said it yourself: SSH tunneling.
On machine C:
ssh -L 12345:machineA:1521 machineB
Then use localhost:12345 in SQL Developer.
With the above, you log in to Machine B from Machine C using SSH, and create a tunnel to the listener port of Machine A through Machine B.
To create a tunnel from MachineC to MachineB I have to use a bastion server. e.g. ssh <bastion> -L 12345:MachineB:<serviceport> , then . how to use MachineA here ?
– kumarprd
Jan 30 '18 at 15:42
@kumarprd If you have another question then post a new question
– miracle173
Jan 30 '18 at 18:33
@miracle173 this reply is related to the same question, if you have read it. I just mentioned the step, that I use to create the tunnel, as the step in the answer is not helping.
– kumarprd
Jan 30 '18 at 19:23
@kumarprd even if it is related it is a different one. So why not follow the policy of this site and post another question?
– miracle173
Jan 30 '18 at 20:54
@miracle173 its not different at all. Try to understand the question and reply.
– kumarprd
Jan 31 '18 at 5:00
|
show 2 more comments
You tried
ssh MachineD -L 15219:MachineB:15220 -L 15220:MachineA:1521
this did not work but you think in the right direction, you want to join two tunnels.
login to MachineD and make a tunnel from your MachineB port 15219 to MachineB port 15220
ssh -L 15219:MachineD:15220 MachineD
So If you now send something to MachineC port 15219 then your ssh session (from MachineC to MachineD) sends it to MachineD port 15220
if you do a
tnsping '(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = MachineC)(PORT = 15219))(CONNECT_DATA = (SERVICE_NAME = ORCL)))'
you will get an error message
TNS-12541: TNS:no listener
or something similar, if you try to connect with SQL Developer.
Because if you now send something to MachineC port 15219 then your ssh session (from MachineC to MachineD) sends it to MachineD port 15220. And on MachineD port 15220 there is actually nobody listening.
Now in your ssh session on MachineD execute the following command
ssh -L 15220:MachineA:1521 MachineB
Now you have opened an ssh session from MachineC to MachineB and data sent to MachineD port 15220 is read by this second ssh session and sent to MachineA port 1521. So you have two ssh sessions and the second one extends the first one.
But instead of opening one ssh session and in this ssh session opneing the other one you can do this in one command
ssh -L 15219:MachineD:15220 MachineD ssh -L 15220:MachineA:1521 MachineB
by juxtaposing both commands. If after an ssh command follows another comman this command is executed after login.
To avoid an error message like
Pseudo-terminal will not be allocated because stdin is not a terminal.
you can use the -T
option for the second `ssh`` command.
ssh -L 15219:MachineD:15220 MachineD ssh -T -L 15220:MachineA:1521 MachineB
If you get some
bind: Address already in use
channel_setup_fwd_listener: cannot listen to port: 15220
messages then change the adresses.
e.g. use 15221 instead of 15220. Of course you must replace it on both posisitions:
ssh -L 15219:MachineD:15221 MachineD ssh -T -L 15221:MachineA:1521 MachineB
I hope this works. It is possible to configure the ssh daemons such that local forwarding is not allowed.
You cann concatenate an arbitrary number of tunnels .
I cannot test the -W option because I get
SSH-2.0-OpenSSH_5.3
Protocol mismatch.
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "182"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f196589%2ftns-connection-forward%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
You said it yourself: SSH tunneling.
On machine C:
ssh -L 12345:machineA:1521 machineB
Then use localhost:12345 in SQL Developer.
With the above, you log in to Machine B from Machine C using SSH, and create a tunnel to the listener port of Machine A through Machine B.
To create a tunnel from MachineC to MachineB I have to use a bastion server. e.g. ssh <bastion> -L 12345:MachineB:<serviceport> , then . how to use MachineA here ?
– kumarprd
Jan 30 '18 at 15:42
@kumarprd If you have another question then post a new question
– miracle173
Jan 30 '18 at 18:33
@miracle173 this reply is related to the same question, if you have read it. I just mentioned the step, that I use to create the tunnel, as the step in the answer is not helping.
– kumarprd
Jan 30 '18 at 19:23
@kumarprd even if it is related it is a different one. So why not follow the policy of this site and post another question?
– miracle173
Jan 30 '18 at 20:54
@miracle173 its not different at all. Try to understand the question and reply.
– kumarprd
Jan 31 '18 at 5:00
|
show 2 more comments
You said it yourself: SSH tunneling.
On machine C:
ssh -L 12345:machineA:1521 machineB
Then use localhost:12345 in SQL Developer.
With the above, you log in to Machine B from Machine C using SSH, and create a tunnel to the listener port of Machine A through Machine B.
To create a tunnel from MachineC to MachineB I have to use a bastion server. e.g. ssh <bastion> -L 12345:MachineB:<serviceport> , then . how to use MachineA here ?
– kumarprd
Jan 30 '18 at 15:42
@kumarprd If you have another question then post a new question
– miracle173
Jan 30 '18 at 18:33
@miracle173 this reply is related to the same question, if you have read it. I just mentioned the step, that I use to create the tunnel, as the step in the answer is not helping.
– kumarprd
Jan 30 '18 at 19:23
@kumarprd even if it is related it is a different one. So why not follow the policy of this site and post another question?
– miracle173
Jan 30 '18 at 20:54
@miracle173 its not different at all. Try to understand the question and reply.
– kumarprd
Jan 31 '18 at 5:00
|
show 2 more comments
You said it yourself: SSH tunneling.
On machine C:
ssh -L 12345:machineA:1521 machineB
Then use localhost:12345 in SQL Developer.
With the above, you log in to Machine B from Machine C using SSH, and create a tunnel to the listener port of Machine A through Machine B.
You said it yourself: SSH tunneling.
On machine C:
ssh -L 12345:machineA:1521 machineB
Then use localhost:12345 in SQL Developer.
With the above, you log in to Machine B from Machine C using SSH, and create a tunnel to the listener port of Machine A through Machine B.
answered Jan 30 '18 at 12:51
Balazs PappBalazs Papp
26.2k2931
26.2k2931
To create a tunnel from MachineC to MachineB I have to use a bastion server. e.g. ssh <bastion> -L 12345:MachineB:<serviceport> , then . how to use MachineA here ?
– kumarprd
Jan 30 '18 at 15:42
@kumarprd If you have another question then post a new question
– miracle173
Jan 30 '18 at 18:33
@miracle173 this reply is related to the same question, if you have read it. I just mentioned the step, that I use to create the tunnel, as the step in the answer is not helping.
– kumarprd
Jan 30 '18 at 19:23
@kumarprd even if it is related it is a different one. So why not follow the policy of this site and post another question?
– miracle173
Jan 30 '18 at 20:54
@miracle173 its not different at all. Try to understand the question and reply.
– kumarprd
Jan 31 '18 at 5:00
|
show 2 more comments
To create a tunnel from MachineC to MachineB I have to use a bastion server. e.g. ssh <bastion> -L 12345:MachineB:<serviceport> , then . how to use MachineA here ?
– kumarprd
Jan 30 '18 at 15:42
@kumarprd If you have another question then post a new question
– miracle173
Jan 30 '18 at 18:33
@miracle173 this reply is related to the same question, if you have read it. I just mentioned the step, that I use to create the tunnel, as the step in the answer is not helping.
– kumarprd
Jan 30 '18 at 19:23
@kumarprd even if it is related it is a different one. So why not follow the policy of this site and post another question?
– miracle173
Jan 30 '18 at 20:54
@miracle173 its not different at all. Try to understand the question and reply.
– kumarprd
Jan 31 '18 at 5:00
To create a tunnel from MachineC to MachineB I have to use a bastion server. e.g. ssh <bastion> -L 12345:MachineB:<serviceport> , then . how to use MachineA here ?
– kumarprd
Jan 30 '18 at 15:42
To create a tunnel from MachineC to MachineB I have to use a bastion server. e.g. ssh <bastion> -L 12345:MachineB:<serviceport> , then . how to use MachineA here ?
– kumarprd
Jan 30 '18 at 15:42
@kumarprd If you have another question then post a new question
– miracle173
Jan 30 '18 at 18:33
@kumarprd If you have another question then post a new question
– miracle173
Jan 30 '18 at 18:33
@miracle173 this reply is related to the same question, if you have read it. I just mentioned the step, that I use to create the tunnel, as the step in the answer is not helping.
– kumarprd
Jan 30 '18 at 19:23
@miracle173 this reply is related to the same question, if you have read it. I just mentioned the step, that I use to create the tunnel, as the step in the answer is not helping.
– kumarprd
Jan 30 '18 at 19:23
@kumarprd even if it is related it is a different one. So why not follow the policy of this site and post another question?
– miracle173
Jan 30 '18 at 20:54
@kumarprd even if it is related it is a different one. So why not follow the policy of this site and post another question?
– miracle173
Jan 30 '18 at 20:54
@miracle173 its not different at all. Try to understand the question and reply.
– kumarprd
Jan 31 '18 at 5:00
@miracle173 its not different at all. Try to understand the question and reply.
– kumarprd
Jan 31 '18 at 5:00
|
show 2 more comments
You tried
ssh MachineD -L 15219:MachineB:15220 -L 15220:MachineA:1521
this did not work but you think in the right direction, you want to join two tunnels.
login to MachineD and make a tunnel from your MachineB port 15219 to MachineB port 15220
ssh -L 15219:MachineD:15220 MachineD
So If you now send something to MachineC port 15219 then your ssh session (from MachineC to MachineD) sends it to MachineD port 15220
if you do a
tnsping '(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = MachineC)(PORT = 15219))(CONNECT_DATA = (SERVICE_NAME = ORCL)))'
you will get an error message
TNS-12541: TNS:no listener
or something similar, if you try to connect with SQL Developer.
Because if you now send something to MachineC port 15219 then your ssh session (from MachineC to MachineD) sends it to MachineD port 15220. And on MachineD port 15220 there is actually nobody listening.
Now in your ssh session on MachineD execute the following command
ssh -L 15220:MachineA:1521 MachineB
Now you have opened an ssh session from MachineC to MachineB and data sent to MachineD port 15220 is read by this second ssh session and sent to MachineA port 1521. So you have two ssh sessions and the second one extends the first one.
But instead of opening one ssh session and in this ssh session opneing the other one you can do this in one command
ssh -L 15219:MachineD:15220 MachineD ssh -L 15220:MachineA:1521 MachineB
by juxtaposing both commands. If after an ssh command follows another comman this command is executed after login.
To avoid an error message like
Pseudo-terminal will not be allocated because stdin is not a terminal.
you can use the -T
option for the second `ssh`` command.
ssh -L 15219:MachineD:15220 MachineD ssh -T -L 15220:MachineA:1521 MachineB
If you get some
bind: Address already in use
channel_setup_fwd_listener: cannot listen to port: 15220
messages then change the adresses.
e.g. use 15221 instead of 15220. Of course you must replace it on both posisitions:
ssh -L 15219:MachineD:15221 MachineD ssh -T -L 15221:MachineA:1521 MachineB
I hope this works. It is possible to configure the ssh daemons such that local forwarding is not allowed.
You cann concatenate an arbitrary number of tunnels .
I cannot test the -W option because I get
SSH-2.0-OpenSSH_5.3
Protocol mismatch.
add a comment |
You tried
ssh MachineD -L 15219:MachineB:15220 -L 15220:MachineA:1521
this did not work but you think in the right direction, you want to join two tunnels.
login to MachineD and make a tunnel from your MachineB port 15219 to MachineB port 15220
ssh -L 15219:MachineD:15220 MachineD
So If you now send something to MachineC port 15219 then your ssh session (from MachineC to MachineD) sends it to MachineD port 15220
if you do a
tnsping '(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = MachineC)(PORT = 15219))(CONNECT_DATA = (SERVICE_NAME = ORCL)))'
you will get an error message
TNS-12541: TNS:no listener
or something similar, if you try to connect with SQL Developer.
Because if you now send something to MachineC port 15219 then your ssh session (from MachineC to MachineD) sends it to MachineD port 15220. And on MachineD port 15220 there is actually nobody listening.
Now in your ssh session on MachineD execute the following command
ssh -L 15220:MachineA:1521 MachineB
Now you have opened an ssh session from MachineC to MachineB and data sent to MachineD port 15220 is read by this second ssh session and sent to MachineA port 1521. So you have two ssh sessions and the second one extends the first one.
But instead of opening one ssh session and in this ssh session opneing the other one you can do this in one command
ssh -L 15219:MachineD:15220 MachineD ssh -L 15220:MachineA:1521 MachineB
by juxtaposing both commands. If after an ssh command follows another comman this command is executed after login.
To avoid an error message like
Pseudo-terminal will not be allocated because stdin is not a terminal.
you can use the -T
option for the second `ssh`` command.
ssh -L 15219:MachineD:15220 MachineD ssh -T -L 15220:MachineA:1521 MachineB
If you get some
bind: Address already in use
channel_setup_fwd_listener: cannot listen to port: 15220
messages then change the adresses.
e.g. use 15221 instead of 15220. Of course you must replace it on both posisitions:
ssh -L 15219:MachineD:15221 MachineD ssh -T -L 15221:MachineA:1521 MachineB
I hope this works. It is possible to configure the ssh daemons such that local forwarding is not allowed.
You cann concatenate an arbitrary number of tunnels .
I cannot test the -W option because I get
SSH-2.0-OpenSSH_5.3
Protocol mismatch.
add a comment |
You tried
ssh MachineD -L 15219:MachineB:15220 -L 15220:MachineA:1521
this did not work but you think in the right direction, you want to join two tunnels.
login to MachineD and make a tunnel from your MachineB port 15219 to MachineB port 15220
ssh -L 15219:MachineD:15220 MachineD
So If you now send something to MachineC port 15219 then your ssh session (from MachineC to MachineD) sends it to MachineD port 15220
if you do a
tnsping '(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = MachineC)(PORT = 15219))(CONNECT_DATA = (SERVICE_NAME = ORCL)))'
you will get an error message
TNS-12541: TNS:no listener
or something similar, if you try to connect with SQL Developer.
Because if you now send something to MachineC port 15219 then your ssh session (from MachineC to MachineD) sends it to MachineD port 15220. And on MachineD port 15220 there is actually nobody listening.
Now in your ssh session on MachineD execute the following command
ssh -L 15220:MachineA:1521 MachineB
Now you have opened an ssh session from MachineC to MachineB and data sent to MachineD port 15220 is read by this second ssh session and sent to MachineA port 1521. So you have two ssh sessions and the second one extends the first one.
But instead of opening one ssh session and in this ssh session opneing the other one you can do this in one command
ssh -L 15219:MachineD:15220 MachineD ssh -L 15220:MachineA:1521 MachineB
by juxtaposing both commands. If after an ssh command follows another comman this command is executed after login.
To avoid an error message like
Pseudo-terminal will not be allocated because stdin is not a terminal.
you can use the -T
option for the second `ssh`` command.
ssh -L 15219:MachineD:15220 MachineD ssh -T -L 15220:MachineA:1521 MachineB
If you get some
bind: Address already in use
channel_setup_fwd_listener: cannot listen to port: 15220
messages then change the adresses.
e.g. use 15221 instead of 15220. Of course you must replace it on both posisitions:
ssh -L 15219:MachineD:15221 MachineD ssh -T -L 15221:MachineA:1521 MachineB
I hope this works. It is possible to configure the ssh daemons such that local forwarding is not allowed.
You cann concatenate an arbitrary number of tunnels .
I cannot test the -W option because I get
SSH-2.0-OpenSSH_5.3
Protocol mismatch.
You tried
ssh MachineD -L 15219:MachineB:15220 -L 15220:MachineA:1521
this did not work but you think in the right direction, you want to join two tunnels.
login to MachineD and make a tunnel from your MachineB port 15219 to MachineB port 15220
ssh -L 15219:MachineD:15220 MachineD
So If you now send something to MachineC port 15219 then your ssh session (from MachineC to MachineD) sends it to MachineD port 15220
if you do a
tnsping '(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = MachineC)(PORT = 15219))(CONNECT_DATA = (SERVICE_NAME = ORCL)))'
you will get an error message
TNS-12541: TNS:no listener
or something similar, if you try to connect with SQL Developer.
Because if you now send something to MachineC port 15219 then your ssh session (from MachineC to MachineD) sends it to MachineD port 15220. And on MachineD port 15220 there is actually nobody listening.
Now in your ssh session on MachineD execute the following command
ssh -L 15220:MachineA:1521 MachineB
Now you have opened an ssh session from MachineC to MachineB and data sent to MachineD port 15220 is read by this second ssh session and sent to MachineA port 1521. So you have two ssh sessions and the second one extends the first one.
But instead of opening one ssh session and in this ssh session opneing the other one you can do this in one command
ssh -L 15219:MachineD:15220 MachineD ssh -L 15220:MachineA:1521 MachineB
by juxtaposing both commands. If after an ssh command follows another comman this command is executed after login.
To avoid an error message like
Pseudo-terminal will not be allocated because stdin is not a terminal.
you can use the -T
option for the second `ssh`` command.
ssh -L 15219:MachineD:15220 MachineD ssh -T -L 15220:MachineA:1521 MachineB
If you get some
bind: Address already in use
channel_setup_fwd_listener: cannot listen to port: 15220
messages then change the adresses.
e.g. use 15221 instead of 15220. Of course you must replace it on both posisitions:
ssh -L 15219:MachineD:15221 MachineD ssh -T -L 15221:MachineA:1521 MachineB
I hope this works. It is possible to configure the ssh daemons such that local forwarding is not allowed.
You cann concatenate an arbitrary number of tunnels .
I cannot test the -W option because I get
SSH-2.0-OpenSSH_5.3
Protocol mismatch.
edited Feb 2 '18 at 6:06
answered Feb 1 '18 at 18:02
miracle173miracle173
6,5271837
6,5271837
add a comment |
add a comment |
Thanks for contributing an answer to Database Administrators Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f196589%2ftns-connection-forward%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
how do you connect ti the exadata at the moment. Using sqlplus from machine B? If so, how do you connect to machine B?
– miracle173
Jan 31 '18 at 8:31
@miracle173 yes , using sqlplus from machineB, From MachineC I use this: ssh MachineD -W MachineB:22 to login
– kumarprd
Feb 1 '18 at 11:00
did my solution work?
– miracle173
Feb 7 '18 at 3:23
@miracle173, thank you for the detailed solution. Actually I am seeing some firewall issue, where connection is getting refused while accessing the port after creating the tunnel.
– kumarprd
Feb 12 '18 at 15:29