This will explain how to change the default SSH port in Mac OS X from 22 to something else.
This drastically reduces the risk of intrusion.
There are different ways to do this, but this is the most convenient way in my opinion.
1. Open up a terminal and enter
sudo pico /etc/services
Enter your password.
2. Scroll down to the very bottom and add the following line:
secret-ssh 12345/tcp # secret SSH port
Replace 12345 with your desired port number, making sure that it doesn’t interfere with anything else running on your system.
3. Press CTRL-X and confirm by pressing Y and enter to save the file.
4. Now we need to modify /System/Library/LaunchDaemons/ssh.plist.
Again in the terminal, enter:
sudo pico /System/Library/LaunchDaemons/ssh.plist
Locate the following:
Replace ssh with secret-ssh.
Save and exit as before.
5. Enter the following commands or reboot your machine to make the changes take effect:
sudo launchctl unload /System/Library/LaunchDaemons/ssh.plist
sudo launchctl load /System/Library/LaunchDaemons/ssh.plist
6. You’re done!