Terminal Default SSH Port - A Way to Change?

Discussion in 'Mac Apps and Mac App Store' started by Gareth-HFX, Aug 3, 2008.

  1. Gareth-HFX macrumors newbie

    Joined:
    Aug 3, 2008
    #1
    Hello,

    Long time reader, first time posted. I switched to Mac last Monday after 8 years on Windows. Here's what I went for;

    -----
    IMAC 24inch
    2.8GHZ INTEL CORE 2 DUO
    4GB 800MHZ DDR2 SDRAM - 2x2GB
    ATI RADEON HD 2600 PRO W/256MB
    320GB SERIAL ATA DRIVE
    -----

    Anyway, I have to connect to another server for some internet-related work, but when I try and use Terminal it always tries to connect to port 22. For security reasons, I have changed my SSH port to something else, so I'm basically wondering if there's a way to change the port that Terminal connects to when connecting to SSH...?

    Thank you in advance,
    Gareth
     
  2. poolish macrumors regular

    Joined:
    Jul 23, 2007
    Location:
    south coast, uk
  3. bankshot macrumors 65816

    bankshot

    Joined:
    Jan 23, 2003
    Location:
    Southern California
    #3
    Another way is to edit the file .ssh/config (under your home directory) and add lines like this:
    Code:
    Host remoteservername
    User remoteusername
    Port portnumber
    You can add multiple sections like that for any remote host you connect to - the lines directly underneath any Host line only apply to that host. You can type man ssh_config in the Terminal for more info.
     

Share This Page