LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
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, 12:01 PM   #1
xeon123
Member
 
Registered: Sep 2006
Posts: 367

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, 08:01 PM   #2
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,758

Rep: Reputation: 644Reputation: 644Reputation: 644Reputation: 644Reputation: 644Reputation: 644
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, 05:41 AM   #3
xeon123
Member
 
Registered: Sep 2006
Posts: 367

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 06:27 AM.
 
Old 01-11-2012, 11:00 AM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 27,810
Blog Entries: 54

Rep: Reputation: 2986Reputation: 2986Reputation: 2986Reputation: 2986Reputation: 2986Reputation: 2986Reputation: 2986Reputation: 2986Reputation: 2986Reputation: 2986Reputation: 2986
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, 06:34 PM   #5
zhjim
Senior Member
 
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,467
Blog Entries: 11

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

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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 02:14 PM
attach a process to init sagar.1986 Linux - General 1 04-24-2007 08:01 AM
attach gdb to a running process linwenyuan Linux - Desktop 1 10-15-2006 02:50 AM
How can i attach gdb to a daemon process praveengujar Linux - General 0 08-11-2004 07:58 AM
ssh to initiate process on remote machine jdarren Linux - Networking 3 03-23-2004 06:55 PM


All times are GMT -5. The time now is 01:21 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration