To enable SSH access on macOS, follow these steps:
1. Open System Preferences: Click on the Apple menu and select "System Preferences." 2. Go to Sharing: Click on "Sharing" in the System Preferences window. 3. Enable Remote Login: - In the list on the left, check the box next to "Remote Login." - You'll see a message saying "Remote Login: On" with some information about how to connect. 4. Choose who can connect: - By default, all users with accounts on the Mac can connect via SSH. - To limit access, click the "Only these users" radio button under "Allow access for:" - Click the "+" button to add specific users who should have SSH access. 5. Configure the firewall (if enabled): - Go back to System Preferences and click on "Security & Privacy." - Click the "Firewall" tab. - If the firewall is on, click "Firewall Options." - Make sure "Remote Login" is checked to allow incoming SSH connections. 6. Find your IP address: - Go to System Preferences > Network. - Select your active connection (like Wi-Fi or Ethernet) and note the IP address. 7. Connect via SSH: - From another computer, use the terminal and type: ssh username@ip_address Replace "username" with your macOS username and "ip_address" with your Mac's IP address. 8. (Optional) Set up SSH keys for more secure access: - This involves generating an SSH key pair and adding the public key to your Mac. - It's more secure than password authentication. Remember, enabling SSH access opens up your Mac to remote connections, so ensure you have strong passwords and consider using SSH keys for authentication.