LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-24-2014, 10:13 AM   #1
NotionCommotion
Member
 
Registered: Aug 2012
Posts: 717

Rep: Reputation: Disabled
Accessing a second server using single public IP


I have two servers (A and B) behind a cheap d-link firewall. The firewall is set up to forward port 22 to Server A. How can I remotely access Server B?
 
Old 03-24-2014, 10:15 AM   #2
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,211

Rep: Reputation: 1612Reputation: 1612Reputation: 1612Reputation: 1612Reputation: 1612Reputation: 1612Reputation: 1612Reputation: 1612Reputation: 1612Reputation: 1612Reputation: 1612
.. Set up a port forward on port 2222 to server b?

.. Make sure both are on the same private subnet and access b from a?

.. Set up an open vpn server on server a, in the same subnet as b, and vpn in?

.. The options here are many,.. you would have to be more specific in your requirements, as to what you want to do and why.

Last edited by szboardstretcher; 03-24-2014 at 10:16 AM.
 
Old 03-24-2014, 10:16 AM   #3
NotionCommotion
Member
 
Registered: Aug 2012
Posts: 717

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by szboardstretcher View Post
.. Set up a port forward on port 2222 to server b?
I suppose, but I was thinking something like ssh'ing into Server A, and then locally connecting to Server B.

EDIT. I just read your edited post. I just want to be able to access the Server B shell from a remote location.

Last edited by NotionCommotion; 03-24-2014 at 10:18 AM.
 
Old 03-24-2014, 10:17 AM   #4
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fc-15/ fc-20-live-usb/ aix
Posts: 5,150

Rep: Reputation: 887Reputation: 887Reputation: 887Reputation: 887Reputation: 887Reputation: 887Reputation: 887
what i usually do is ssh to my fedora machine (port forwarded from router) and if needed i would then ssh to my xbmc machine, nas or fone ...
 
Old 03-24-2014, 10:18 AM   #5
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,211

Rep: Reputation: 1612Reputation: 1612Reputation: 1612Reputation: 1612Reputation: 1612Reputation: 1612Reputation: 1612Reputation: 1612Reputation: 1612Reputation: 1612Reputation: 1612
Quote:
Originally Posted by NotionCommotion View Post
I suppose, but I was thinking something like ssh'ing into Server A, and then locally connecting to Server B.
As long as both are on the same subnet you should have no problem with this. For example, if both machines have 192.168.100.x addresses, then they should be able to communicate directly to one another. Is this not the case?
 
Old 03-24-2014, 10:20 AM   #6
NotionCommotion
Member
 
Registered: Aug 2012
Posts: 717

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by schneidz View Post
what i usually do is ssh to my fedora machine (port forwarded from router) and if needed i would then ssh to my xbmc machine, nas or fone ...
Cool! I've never used Linux ssh before, only Windows puTTY. Very nice!
 
Old 03-24-2014, 10:23 AM   #7
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,211

Rep: Reputation: 1612Reputation: 1612Reputation: 1612Reputation: 1612Reputation: 1612Reputation: 1612Reputation: 1612Reputation: 1612Reputation: 1612Reputation: 1612Reputation: 1612
Quote:
Originally Posted by NotionCommotion View Post
Cool! I've never used Linux ssh before, only Windows puTTY. Very nice!
Windows putty uses ssh. Btw: I moved on to mremote because it allows me to ssh and rdp all in the same tabbable shell.
 
Old 03-24-2014, 07:27 PM   #8
Doug G
Member
 
Registered: Jul 2013
Posts: 749

Rep: Reputation: Disabled
Another alternative is to set up a port forward over the initial ssh connection, something like:
Code:
ssh -L 12345:<lan ip of serverB>:22 serverA
Then from another terminal on your workstation ssh -p 12345 serverA and you should connect to serverB. I use forwarding like this on sites I access remotely for access to any internal computer with sshd, to access a router http configuration screens, etc.
 
  


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
accessing to DB systems installed in 2 servers through one single public IP htamayo Linux - Server 1 11-06-2012 05:12 AM
Command to see all ip's that accessing my public Apache server piyushsingh Linux - Newbie 5 10-05-2012 04:48 AM
both public & private shares in a single samba server Gil@LQ Linux - Server 1 12-20-2011 01:57 AM
Accessing a local server with a public IP ganninu Linux - Networking 5 12-29-2003 05:07 AM
Accessing my public ip. CurlyMo Linux - Networking 26 03-10-2003 01:45 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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