Find the answer to your Linux question:
Results 1 to 4 of 4
Hello All, I am relatively new to networking, so please tell me if I missed some important info or something. (I am also new to Linux Forums, and it's not ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Feb 2011
    Posts
    23

    Question A newbie's questions about networking


    Hello All,
    I am relatively new to networking, so please tell me if I missed some important info or something. (I am also new to Linux Forums, and it's not letting me use the at sign yet, so I'll use percent signs until I have 15 posts. ) I have two servers on my LAN, one Debian and one Ubuntu. Their names are aura and neko respectively. aura is hosting a game server (minecraft) and ssh, and neko is running ssh and ftp. I would like to be able access each's ssh from the outside world without changing the port numbers on my router. I have a setup right now where my router forwards external port 900 to aura's port 22, and external port 22 to neko's internal port 22. I would like to be able to type
    Code:
    ssh me%aura.mydomain.com
    and
    Code:
    ssh me%neko.mydomain.com
    instead of what specifying a different port number for each one and was wondering how I might go about this. Any ideas? Thanks in advance.

  2. #2
    Super Moderator Roxoff's Avatar
    Join Date
    Aug 2005
    Location
    Nottingham, England
    Posts
    3,885
    Take a look at the man page for ssh_config (do 'man ssh_config'). This tells you how to set up your ssh configuration. The file it is your own user one (usually ~/.ssh/config) on the machine you're connecting from.

    You can add settings here to specify which port to use and which username to use for each given server. If you're sshing between the machines, into either of them from outside your network and into each other from there, you might also want to adjust the copy of this file on each of your server so they connect the way you'd expect to each other.
    Linux user #126863 - see http://linuxcounter.net/

  3. #3
    Just Joined!
    Join Date
    Feb 2011
    Posts
    23
    Thanks, Roxoff! I have one question after reading this though. The setup that you described forwards connections to other computers for usernames defined in the ~/.ssh/config, so would different usernames be required on each server?

    Update: Maybe more than one question, actually. After reading the ssh_config man page, I am a little lost as to what options I need to set in /etc/ssh/config. Also, I am thinking of configuring aura to handle mail as well (It is more powerful than neko) and was wondering if it was possible to set subdomains to point to different servers within the same LAN. So, something like
    Code:
     
    www >> neko
    mail >> aura
    of course with the same external IP address. Is this done with DNS the same as domain names, is there some other way to to this, or is it not needed at all? (can I just route mail to aura and ftp to neko and point both subdomains at the same external IP)
    Last edited by willnoit; 09-29-2012 at 10:06 PM.

  4. #4
    Super Moderator Roxoff's Avatar
    Join Date
    Aug 2005
    Location
    Nottingham, England
    Posts
    3,885
    For each server (and you can specify them separately in your .ssh/config file) you will want to use the username you're known as on that target server. The idea is to try and get your client to use 'ssh neko' and 'ssh aura' from wherever you are.

    These two services run on different ports. Forwarding is defined on port+ip address, so you can certainly forward the email port to whichever machine is doing it without interrupting your web services.
    Linux user #126863 - see http://linuxcounter.net/

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •