LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-09-2012, 11:01 AM   #1
xeon123
Member
 
Registered: Sep 2006
Posts: 374

Rep: Reputation: 16
Using ssh and nc to attach to a remote process


Hi,

I want to do debug remotely java code, but, to connect to the remote JVM, I've to pass 3 proxys.

Where's the architecture

MYCOMPUTER --> Proxy1 --> Proxy2 --> JAVAMACHINE --> PROCESS:50030

From MYCOMPUTER; I've to pass Proxy1 and Proxy2 to go to the machine where a java process is running. The java process called PROCESS is running in the JAVAMACHINE node.And I want to attach to the port 50030.


I know that configuring the .ssh/config file is the way to go. I've this configuration, but it's not working in the way that I want:

Code:
Host *.ra
       User USER
       ProxyCommand ssh USER@frontend1 "nc -q 10 \$(basename %h .ra) %p"
       StrictHostKeyChecking no
       ServerAliveInterval 120
If I do
[code]
ssh USER@frontend2.ra
[code]

I stop in the frontend2 machine, but I'm not attaching to the PROCESS:50030


How can I set the .ssh/config file to attach to a remote process?
 
Old 01-09-2012, 07:01 PM   #2
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653
It might be simpler to just set up a ssh tunnel to the target server, then you can just connect to localhost:50030 and it will get passed through to the target.
 
Old 01-10-2012, 04:41 AM   #3
xeon123
Member
 
Registered: Sep 2006
Posts: 374

Original Poster
Rep: Reputation: 16
I've found the solution here:
http://superuser.com/questions/96489...-multiple-hops

Although, I want something little different.
LOCALHOST --> FRONTEND1 --> FRONTEND2 --> MACHINE:9009

To go to the host MACHINE, I've to pass 2 hosts from the localhost. I don't know how to set a tunnel with 2 hosts in the middle. Any help?

Last edited by xeon123; 01-10-2012 at 05:27 AM.
 
Old 01-11-2012, 10:00 AM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by xeon123 View Post
I don't know how to set a tunnel with 2 hosts in the middle.
I told you last year: http://www.linuxquestions.org/questi...9/#post4287985
 
Old 01-11-2012, 05:34 PM   #5
zhjim
Senior Member
 
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,748
Blog Entries: 11

Rep: Reputation: 233Reputation: 233Reputation: 233
Unspawn you should be nominated for the "moderator of the year" full stop
 
Old 01-12-2012, 12:50 AM   #6
xeon123
Member
 
Registered: Sep 2006
Posts: 374

Original Poster
Rep: Reputation: 16
I'll try this configuration with 2 frontends in the middle, and not just one. I didn't remember that post.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Using sh and nc to attach to a remote process xeon123 Linux - Software 2 01-09-2012 01:14 PM
attach a process to init sagar.1986 Linux - General 1 04-24-2007 07:01 AM
attach gdb to a running process linwenyuan Linux - Desktop 1 10-15-2006 01:50 AM
How can i attach gdb to a daemon process praveengujar Linux - General 0 08-11-2004 06:58 AM
ssh to initiate process on remote machine jdarren Linux - Networking 3 03-23-2004 05:55 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:48 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration