Benches macOS

2

How do you change Terminal ssh port setting?

apple Verified

Imported from the Apple Support Forums via the Wayback Machine 🔗

My ISP changed its ssh port from 22 to 100. I've tried to change it in Terminal but it stays at 22. I opened etc/ssh_config as administrator, changed it there and saved the change, but it stays at 22. Any help would be much appreciated.

2 replies

Sign in or join Beachball Help to reply.

  1. 0

    V.K.

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    see this link:

    http://www.macosxhints.com/article.php?story=20050707140439980

    you'll have to use -p switch when invoking ssh to connect to your computer from the outside

    ssh -p 100 [email protected]

    also, instead of using that link and reconfiguring your ssh port you can forward port 100 on your router to port 22 on your computer. either way you'll have to use ssh -p 100 to ssh to your computer.

    Message was edited by: V.K.

  2. 0

    BobHarris

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    My ISP changed its ssh port from 22 to 100. I've tried to change it in Terminal but it stays at 22.

    I just want to clarify which side's ssh port has changed to 100.

    Do you ssh into a server at your ISP and your ISP has changed their ssh daemon's port to 100, and now you need to know how to ssh to port 100?


    ssh -p 100 ...

    You can add an entry to *$HOME/.ssh/config* like the following:


    Host your.ips.server
    Port 100

    What this should do, is any ssh to that DNS name or IP address will go to port 100, all other ssh connections will go to port 22

    NOTE: the $HOME/.ssh directory needs specific restrictive permissions. See the ssh man page for what permissions.

    If you mean something else about "...its ssh port from 22 to 100...", then I would need more clarification.