Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.

Notices

Welcome to LinuxQuestions.org, a friendly and active Linux Community.

You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!

Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.

If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.

Having a problem logging in? Please visit this page to clear all LQ-related cookies.

Introduction to Linux - A Hands on Guide

This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.

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

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?

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

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.

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

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.