Disable SSH Preference via Terminal


Recommended Posts

Hi All,

How would one disable SSH via the Terminal in OS X? Specifically I'm looking how to permanently disable this setting via a script:

post-180771-0-11270800-1358160854.png

Thanks

Chris

Link to comment
Share on other sites

I don't use os x all that much, but its lots is the same as any linux distro. You could always stop the service via the service command, its controlled with sbin/service is in not so ssh stop should do it.

As to how to make it not start again on reboot - hmm

os x uses system/library then like coreservices, services, etc. for its startup stuff?? Have never had desire to look that deep into the os before. Not really a fan ;)

so you can for sure stop it with /sbin/service or it seems the more uptodate launchctl -- but its going to just restart on reboot I would think. Just tested

post-14624-0-93949300-1358176924.jpg

Link to comment
Share on other sites

Hi,

I am not near my Mac right now but I believe the SSH is combined within "Remote Login" but you can stop the service or close port 22.

Link to comment
Share on other sites

I seem to have a few unusual connections in netstat considering my configuration, any advice?

post-105752-0-76184500-1358410359.png

post-105752-0-69637800-1358410361.png

Link to comment
Share on other sites

and how is that related to remote login? Or odd? or unusual in anyway?

That is your box on 10.0.0.8 connected to Apple network

NetRange: 17.0.0.0 - 17.255.255.255

CIDR: 17.0.0.0/8

NetName: APPLE-WWNET

OrgName: Apple Inc.

Looks like a push notification IP to me

dig -x 17.172.233.118 +short

st11p01st-hpaj262312-bz.push.apple.com.

And for verification of that assumption your connected on port 5223 -- which is a well known port used by apple products

https://support.apple.com/kb/TS1629

5223 TCP Apple Push Notification Service - - iCloud DAV Services (Contacts, Calendars, and Bookmarks), APNS, FaceTime, Game Center, Photo Stream, Back to My Mac

Nothing to do with the thread at hand though ;)

Link to comment
Share on other sites

This topic is now closed to further replies.