IPhone – SSH into the Mac from an iPhone over Wi-Fi LAN with no connection to the internet

iphoneNetworksshwifi

I want to use ssh to get into my mac from an iPhone over Wi-Fi LAN with no connection to the internet. I want to do this to get access to the command line (for playing with programming related stuff) while I'm on the couch.

I do not need an internet connection on the Mac while I do this, so it's fine for me to reserve the Macs' Wi-Fi connection for communicating with the iPone. However, When I create a network on my Mac and connect the iPhone to the network I created, it seems to work in the Wi-Fi menu, but there is no change in the networking icon from 4g to Wi-Fi.

Will an SSH server on the Mac still be accessible to an SSH app on an iPhone? I've had trouble with file sharing from third party apps that don't know that they have a Wi-Fi connection when it's not connected to the internet. Though this does work when I use an android device to create a hotspot.

Best Answer

Yes. You can. However the Apple Mac OS X operating system has SSH installed by default but the SSH daemon is not enabled. This means you can’t login remotely or do remote copies until you enable it.

To enable it, go to ‘System Preferences’. Under ‘Internet & Networking’ there is a ‘Sharing’ icon. Run that. In the list that appears, check the ‘Remote Login’ option.

This starts the SSH daemon immediately and you can remotely login using your username. The ‘Sharing’ window shows at the bottom the name and IP address to use. You can also find this out using ‘whoami’ and ‘ifconfig’ from the Terminal application.

An app called iTerminal - SSH Telnet Client is available free on the App Store. It allows you to connect via SSH to your Mac iTerminal.

Another app called Reflection for UNIX - SSH Client will also do this for free.

To run the server without Internet will be fine. The DCHP server will still allow access with Bonjour and manually inputting the IP address of the Mac.