Our vulnerability reports show that our Macs are running OpenSSH 7.9 and need to be updated to 8.1. The OS is Mojave. This doesn't seem to be as straight forward as on A PC. Any ideas on how this is done?
Install Openssh Mac
First thing to note is that ssh is not enabled by default on any install of OS X (excluding server, which is a now-dead version, as a separate build and customizations of OS X). Upgrading is easy, use MacPorts (many will without question suggest homebrew, I prefer and recommend MacPorts based on historical - personal - experience). Hello, I want to install and configure 'openSSH-server' on Mac OS X 10.9. As I realized openSSH-server was preinstalled, and It runs: 'System Preferences' - 'Sharing & Permissions' click on 'Remote login'.
First thing to note is that ssh is not enabled by default on any install of OS X (excluding server, which is a now-dead version, as a separate build and customizations of OS X).
Upgrading is easy, use MacPorts (many will without question suggest homebrew, I prefer and recommend MacPorts based on historical - personal - experience).
Openssh Mac Os X Installer
One would have to modify
/System/Library/LaunchDaemons/ssh.plistto use said upgraded ssh (which will get installed via MacPorts - by default - to /opt/local ), which is no small task especially for Mojave, in which /System is protected by SIP.
No-one with a meaningful knowledge of security and macOS (Mac OS X) will recommend disabling SIP. One might be able to do so temporarily, but that's another hill to climb/problem to solve.
Technically, you could leave the default installed openssh alone, but that will still get used when using the macOS GUI (System Preferences > Sharing) to enable ssh ('Remote Login'), unless you managed to edit the above-named plist to point to your updated version.
You can use SSH to connect to your Raspberry Pi from a Linux computer, a Mac, or another Raspberry Pi, without installing additional software.
You will need to know your Raspberry Pi's IP address to connect to it. To find this, type
hostname -I from your Raspberry Pi terminal.
If you are running the Pi without a screen (headless), you can also look at the device list on your router or use a tool like
nmap, which is described in detail in our IP Address document.
Mac Openssh Server
To connect to your Pi from a different computer, copy and paste the following command into the terminal window but replace
<IP> with the IP address of the Raspberry Pi. Use
Ctrl + Shift + V to paste in the terminal.
If you receive a
connection timed out error it is likely that you have entered the wrong IP address for the Raspberry Pi.
When the connection works you will see a security/authenticity warning. Type
yes to continue. You will only see this warning the first time you connect.
In the event your Pi has taken the IP address of a device to which your computer has connected before (even if this was on another network), you may be given a warning and asked to clear the record from your list of known devices. Following this instruction and trying the
ssh command again should be successful.
Next you will be prompted for the password for the
pi login: the default password on Raspberry Pi OS is
raspberry. For security reasons it is highly recommended to change the default password on the Raspberry Pi. You should now be able to see the Raspberry Pi prompt, which will be identical to the one found on the Raspberry Pi itself.
If you have set up another user on the Raspberry Pi, you can connect to it in the same way, replacing the username with your own, e.g.
You are now connected to the Pi remotely, and can execute commands.
You can also forward your X session over SSH, to allow the use of graphical applications, by using the
Note that X11 is no longer present on Macs with OSX, so you will have to download and install it.
Now you are on the command line as before, but you have the ability to open up graphical windows. For example, typing:
will open up the Geany editor in a graphical window.
will open up Scratch.
For further documentation on the
ssh command just enter
man ssh into the Terminal.
To configure your Pi to allow passwordless SSH access with a public/private key pair, see the passwordless SSH guide.