change ssh port on mac os x

Wed, Jun 1, 2005

NOTE - this has been deprecated in OS X 10.4. Here’s a good article on how to change the ssh port on 10.4

By default, ssh is on port 22. To change incoming connections to port 66666, edit the file /etc/xinetd.d/ssh. Note, this step doesn’t seem to be required on Tiger:

service ssh { disable = no socket_type = stream wait = no user = root server = /usr/libexec/sshd-keygen-wrapper server_args = -i groups = yes flags = REUSE IPv6 session_create = yes port = 66666 }

Edit /etc/ssh_config Uncomment the line that says Port 22. If you don’t, all outgoing connections will be on the new port too!

/etc/services change ssh tcp/udp entries to 66666

System Preferences -> Sharing -> Firewall -> New -> Other Port = 66666 Description = SSH on high port

System Preferences -> Sharing -> Services -> Remote Login Stop then Start

kill -HUP cat ‘/var/run/’

comments powered by Disqus