LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
LinkBack Search this Thread
Old 03-07-2011, 06:08 AM   #1
tkmsr
Member
 
Registered: Oct 2006
Distribution: Ubuntu,Open Suse,Debian,Mac OS X
Posts: 798

Rep: Reputation: 38
giving SSH access to machines on LAN from internet


Hi, I am having a server in a corporate data centre. There are some virtual machines running on it.The main server is accessible from internet via SSH. There are some people who within the lan access the virtual machines whose IPs on LAN are
Quote:
192.168.1.1
192.168.1.2
192.168.1.3
192.168.1.4
from internet only one host is allowed SSH.
This machine has public IP and is also connected to LAN on the IP 192.168.1.50.

Tunnel is not allowed on our network.So now I am came across a solution as explained on this link.
I am not clear with on which machine .ssh/config file I add following
Code:
Host securehost.example.com     
ProxyCommand ssh user1@insidemachine.com nc %h %p
Should above be done on gateway where public IP and ssh is allowed or client on internet who has to login.

Do I need to create separate accounts on the gateway also so that the users who can SSH to gateway then are forwarded to inside machines? Or one account on gateway is sufficient for different people logging in via internet to my gateway and then forwarded to internal machine?

Then do I need to create an account user1 on the gateway also?


1) What is the correct syntax for ProxyCommand on gateway's .ssh/config should I use
Code:
ProxyCommand ssh user1@inside.machine nc %h %p
or I should use
Code:
ProxyCommand    ssh user1@gateway.com in nc %h %p


2) Should I create new user accounts on gateway also which exist on internal machine?

Last edited by tkmsr; 03-07-2011 at 06:12 AM.
 
Old 03-07-2011, 04:54 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,344

Rep: Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945
ALL the config they've given is for your client. You wil be logging in fully to both machines, so need suitable accounts on both. They don't have to be the same account, but in the guide that is how they have configured it by using the %u. You could replace that with a static account if you wanted to.

As for what format for the proxy command, where did the 2nd one come from? 1hr 1st is what is in the guide
 
Old 03-08-2011, 08:48 PM   #3
Juako
Member
 
Registered: Mar 2010
Posts: 202

Rep: Reputation: 84
I don't get it. If the point is to have an intermediary machine between your client on the Internet and the server inside your network, why don't you just ssh to the intermediary machine and then ssh again from that machine to the internal server? With pubkey auth + agent forwarding this is a matter of seconds. Mind that in this fashion you don't have to store ANY private key in the intermediary machine...

Otherwise i'd also consider just dnating the internal ssh port to outside.
 
Old 03-08-2011, 10:07 PM   #4
tkmsr
Member
 
Registered: Oct 2006
Distribution: Ubuntu,Open Suse,Debian,Mac OS X
Posts: 798

Original Poster
Rep: Reputation: 38
Quote:
Originally Posted by Juako View Post
I don't get it. If the point is to have an intermediary machine between your client on the Internet and the server inside your network, why don't you just ssh to the intermediary machine and then ssh again from that machine
My boss does not wants this so he asked me a one step solution.
 
Old 03-09-2011, 02:16 AM   #5
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,344

Rep: Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945
Quote:
Originally Posted by Juako View Post
I don't get it. If the point is to have an intermediary machine between your client on the Internet and the server inside your network, why don't you just ssh to the intermediary machine and then ssh again from that machine to the internal server? With pubkey auth + agent forwarding this is a matter of seconds. Mind that in this fashion you don't have to store ANY private key in the intermediary machine...

Otherwise i'd also consider just dnating the internal ssh port to outside.
Well I don't get *this*... the article gives a really simple mechanism of taking this two step system and simplifying it slightly to make a one step system. What you're left with is exactly what you're suggesting, just a bit more polished.
 
  


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Ubuntu server cannot access internet but LAN machines can. librano Linux - Server 2 05-13-2007 01:17 PM
Apache2: LAN machines cannot access website Akhran Linux - Newbie 1 10-13-2005 05:39 AM
Two machines and internet access cyclic Linux - Networking 5 02-25-2004 03:38 AM
LAN machines unable to connect to Internet through (firewall on )gateway nishi_k_79 Linux - Security 1 11-13-2003 01:30 PM
ssh to multiple lan machines from the internet - How? v00d00101 Linux - Newbie 4 06-20-2003 01:39 PM


All times are GMT -5. The time now is 09:47 AM.

Main Menu
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