How to change the default SSH port in MacOS using Terminal

This is simple. Open a terminal and follow the steps below. This worked for me on MacOS 10.13.6 Open the Terminal. Run sudo vim /etc/services Enter your password Find the lines assigned to port 22, something like the image below Replace both ports 22 with your desired ssh port using a number between 1024 and …