Enable SSH on Linux, Mac and Windows Devices
This document explains how to enable SSH on various operating systems for Faveo Network Discovery, allowing data collection from these devices.
1. Linux
a. For Debian-based Systems
- Install OpenSSH Server:
sudo apt install openssh-server sudo systemctl enable ssh sudo systemctl start ssh
- Enable SSH in the Firewall (if the firewall is enabled):
sudo ufw allow ssh sudo ufw enable sudo ufw status
- Check if
OpenSSH
Server` is Installed:sudo dpkg -l | grep openssh-server sudo apt list --installed | grep openssh-server systemctl status ssh
b. For RHEL-based Systems
- Install OpenSSH Server:
sudo yum install openssh-server sudo systemctl enable sshd sudo systemctl start sshd
- Enable SSH in the Firewall (if the firewall is enabled):
sudo firewall-cmd --permanent --zone=public --add-service=ssh sudo firewall-cmd --reload
- Check if OpenSSH Server is Installed:
- To verify if openssh-server is installed and running, use:
systemctl status sshd
rpm -qa | grep openssh-server
2. Mac
Method 1: Enable SSH via System Preferences
-
Open System Settings: Click the
Apple logo
in the top-left corner, and selectSystem Settings
(orSystem Preferences
in older macOS versions). -
Go to Sharing: In System Settings, scroll down and click
General
, then selectSharing
. On older macOS versions, just clickSharing
. -
Enable Remote Login:
-
In the
Sharing
section, look forRemote Login
. -
Check the box next to
Remote Login
to enable SSH.
- Allow Access: Choose whether to allow access for
All users
or only specific users.
Method 2: Enable SSH via Terminal
-
Open Terminal: Launch the Terminal app (
Applications > Utilities
). - Run the following command to enable SSH
sudo systemsetup -setremotelogin on
- Verify SSH is enabled:
sudo systemsetup -getremotelogin
If it returns
Remote Login: On
, SSH is enabled.
Method 3: Check SSH Status
To check if the SSH service is running:
sudo launchctl list | grep ssh
Once enabled, you can SSH into your Mac using:
ssh your_username@your_mac_ip_address
3. Windows
Method 1: Enable SSH via PowerShell
- Check if OpenSSH is Installed:
Open PowerShell with administrative privileges and run:
Get-WindowsCapability -Online | Where-Object Name -like 'OpenSSH*'
- Install OpenSSH Server (if not present):
Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0
- Start the SSH Server:
To start the SSH server (sshd), run:
Start-Service sshd
- Check SSH Service Status:
Get-Service sshd
- Enable SSH at Startup:
Set-Service -Name sshd -StartupType 'Automatic'
- Check Firewall Rules:
Ensure that the firewall allows SSH traffic:
Get-NetFirewallRule -Name *ssh*
- Add a Firewall Rule (if needed):
New-NetFirewallRule -Name 'OpenSSH-Server-In-TCP' -DisplayName 'OpenSSH Server (sshd)' -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 22
Once enabled, you can use SSH from other devices using the following command:
ssh your_username@your_windows_ip_address