LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 01-08-2013, 11:53 AM   #1
metallica1973
Senior Member
 
Registered: Feb 2003
Location: Washington D.C
Posts: 2,190

Rep: Reputation: 60
Access to Remote tty cli via ssh


Scenario:

I would like the ability to be able to use the cli on a client that has remotely connected to me via my ssh server in my office and use their terminal to work remotely if I am in another remote location.

Ex.

The client reverse ssh's to my remote ssh server in my office.
Code:
ssh -R 10002:localhost:22 client@my-remote-ssh-server
I remotely ssh into my ssh server from another client site.
Code:
ssh -L 3400:localhost:3400 admin@my-remote-ssh-server
and from there I would be connected to the tty of the remote client from wherever I am.

Is this possible?

Code:
ssh -t user@some.domain.com /usr/bin/screen -xRR

or 

ssh -t remote_host screen -r
??
 
Old 01-08-2013, 02:25 PM   #2
nini09
Senior Member
 
Registered: Apr 2009
Posts: 1,853

Rep: Reputation: 161Reputation: 161
Yes, it is double. You can relay SSH connection multi-times if you know where you go and what is current location.
 
Old 01-08-2013, 03:29 PM   #3
metallica1973
Senior Member
 
Registered: Feb 2003
Location: Washington D.C
Posts: 2,190

Original Poster
Rep: Reputation: 60
Thanks for the reply,

Can you elaborate?
 
Old 01-08-2013, 04:03 PM   #4
SecretCode
Member
 
Registered: Apr 2011
Location: UK
Distribution: Kubuntu 11.10
Posts: 562

Rep: Reputation: 102Reputation: 102
On first reading your question I thought it was a simple case of "ssh inside ssh" - a web search returns various useful pages.

But are you in fact trying to reuse an ssh session already set up and authenticated by another person? As in
Code:
    A (you, remote) ------ S (server, office) ----- C (client, remote)
1                                          <----------   C sets up reverse ssh session
2                 ----------> A sets up ssh session
3                                          ----------> A wants cli access to C
I'm not sure if this is possible. Creating a new ssh session from your login shell at 'S' definitely is - why not do that?
 
Old 01-09-2013, 02:18 PM   #5
nini09
Senior Member
 
Registered: Apr 2009
Posts: 1,853

Rep: Reputation: 161Reputation: 161
For example, IP address of the SSH server is 192.168.0.1 and the terminal of one equipment connect with 192.168.0.2 machine.
You can do SSH to SSH server 192.168.0.1 at first and then do SSH to 192.168.0.2 machine again in SSH 192.168.0.1 session. In second session, you monitor the equipment through terminal.
 
Old 01-09-2013, 03:32 PM   #6
metallica1973
Senior Member
 
Registered: Feb 2003
Location: Washington D.C
Posts: 2,190

Original Poster
Rep: Reputation: 60
Many thanks for all the replies.

Code:
A (you, remote) ------ S (server, office) ----- C (client, remote)
1                                          <----------   C sets up reverse ssh session
2                 ----------> A sets up ssh session
3                                          ----------> A wants cli access to C
Exactly. Is this possible?
 
Old 01-10-2013, 04:58 AM   #7
SecretCode
Member
 
Registered: Apr 2011
Location: UK
Distribution: Kubuntu 11.10
Posts: 562

Rep: Reputation: 102Reputation: 102
It's possible and pretty easy if you set up a new ssh session in step 3 - but you'll need the key and/or password for an account on C. Are you trying to avoid that?

I doubt that it's possible for you to reuse an existing ssh session ... it would mean that whenever I ssh into a shared server, any admin on that server can now access my client machine ... not what I want!
 
Old 01-10-2013, 09:44 AM   #8
metallica1973
Senior Member
 
Registered: Feb 2003
Location: Washington D.C
Posts: 2,190

Original Poster
Rep: Reputation: 60
Many thanks for the replies.

The reason that I ask this question is that some of the sites they dont allow ssh access into their network. So typically I have them ssh to my server and up unto this point, I "vnc" to the Gnome desktop and open up a terminal in that manner to be able to work. I wanted to avoid accessing the GUI and be able to access the cli directly. Would "-S" option work using SSH? Is that what I need to be using?
 
Old 01-10-2013, 12:33 PM   #9
SecretCode
Member
 
Registered: Apr 2011
Location: UK
Distribution: Kubuntu 11.10
Posts: 562

Rep: Reputation: 102Reputation: 102
Are these clients in different companies? What kind of things do you need to be able to do on their systems?

When you say vnc, is that to the client's desktop? Why do they allow that if they block ssh?

I'm confused about the security boundaries in this scenario
 
Old 01-10-2013, 12:53 PM   #10
metallica1973
Senior Member
 
Registered: Feb 2003
Location: Washington D.C
Posts: 2,190

Original Poster
Rep: Reputation: 60
Yes,

Most of the clients that I deal with dont want to poke a hole in their firewall(unnecessary open ports) to allow me access to there linux systems. So as a results, I just have them access an ssh server(Reverse ssh) that I setup and then I simply remote into the linux system(Gnome Desktop) and open a terminal and bang away. So in a nutshell, I want to do the samething but the difference being a terminal instead of a desktop.

Last edited by metallica1973; 01-10-2013 at 12:55 PM.
 
Old 01-10-2013, 01:09 PM   #11
SecretCode
Member
 
Registered: Apr 2011
Location: UK
Distribution: Kubuntu 11.10
Posts: 562

Rep: Reputation: 102Reputation: 102
Do these clients all run an ssh server? (Not installed by default on some distros.)

Could you get them to run sshd with an open port (if they have *any* open incoming ports) such as 80, and connect to that using the -p option?
 
Old 01-10-2013, 01:40 PM   #12
metallica1973
Senior Member
 
Registered: Feb 2003
Location: Washington D.C
Posts: 2,190

Original Poster
Rep: Reputation: 60
They are extremely anal and will not do that. TCP:80,443 are used for their HTTP/HTTPS servers so enabling the sshd daemon on these ports will not be a viable option. So based on your answers, I am assuming this cannot be done. Thanks for your help.
 
  


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
not able to access remote via ssh . dharmendrajet Linux - Software 2 03-17-2011 12:21 AM
remote ssh access from port 2222 zodehala Linux - Networking 3 05-26-2009 03:46 PM
making a tty server for remote access c-- Linux - Software 1 02-07-2006 04:58 AM
Remote Access, reverse ssh haxcess Linux - Networking 1 12-09-2005 11:47 AM
Remote access question. (ssh) JohnStormrider Linux - Networking 8 09-20-2005 04:32 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 05:12 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