1

I have OpenSSH installed via MacPorts on a macOS 10.14 system. I want to change the port its listening on to something other than 22, and have changed /opt/local/etc/ssh/ssh_config and uncommented the Port line like so:

Host *
  Port 12345

I then restarted OpenSSH with:

sudo port unload openssh
sudo port load openssh

However I can still only connect on port 22. How do I change the port properly?

1
  • For anyone else trying to get MacPorts to work on port 22 - the default seems to be port 2222 (probably so as to not conflict with the built in "remote login" sharing preferences). I turned off the built in remote login and then edited sshd_config set the port to 22 and it now seems to be working.
    – j-beda
    Commented Aug 8 at 16:59

1 Answer 1

3

Always worth checking some of the related answers, for example, and it hadn't clicked for me at first.

You need to change /opt/local/etc/ssh/sshd_config. You've been amending the default port used by the client config.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .