How to change the default port for SSH?

Discussion in 'macOS' started by Dorfdad, Apr 22, 2008.

  1. Dorfdad macrumors 6502

    Oct 26, 2007
    Im trying to figure out how to modify the port that SSh uses by default which is 22.

    I wan't to change this to 443 so that anyone looking at traffic will see it as SSL web traffic and not SSH (Port wise).

    Ive search high and low and I found some older 10.4 and older stuff which do not work on 10.52

    Ive used terminal /etc and edited both ssh_config and sshd_config removed the # in front of the Port and entered Port 443 there and saved the files.

    Rebooted and checked my router to make sure I allowed traffic on 443 to redirect to my machine but whenever I connect via PUTTY from XP it fails. I fliped the port on the router back to 22 and it connected still.

    So this makes me think there is a file somewhere else that tell OS X what port to use for SSH. Can someone please advise me on that file and the path?

    Thanks in Advance.
  2. Mumford macrumors regular


    Oct 8, 2006
    Altadena, CA
    Edit /System/Library/LaunchDaemons/ssh.plist and change the lines that reads




    (only the second line is different. the first is there to help you find it).
    You don't need to reboot after doing this, just go into System Preferences -> Sharing, then click remote login off and on.

Share This Page