2 Ethernet Interfaces But I Can Only SSH Into One

Abstract: Resolve inability to SSH into a second Ethernet interface by unbinding the SSH daemon from a specific IP and verifying firewall rules.

Created: 2026-08-21 by
You can only SSH into one Ethernet interface because the SSH daemon is bound to a specific IP address or network interface rather than listening on all available addresses. This behavior is often intentional for security but can be confusing when you expect access from any connected network segment. The solution involves checking your SSH configuration file to ensure the ListenAddress directive is not restricting connections to a single interface, or verifying that firewall rules are not blocking traffic on the second interface's port.

Understanding SSH Binding Behavior

By default, many Linux distributions configure the OpenSSH server to listen on all available IPv4 and IPv6 addresses. However, system administrators often modify this setting to enhance security by binding the service to a management interface or a specific internal subnet. If you have two Ethernet interfaces, such as eth0 for public traffic and eth1 for private LAN traffic, the SSH service might only be active on eth0. This binding prevents attackers on the public internet from probing the private interface directly. It also reduces the attack surface by limiting the number of open ports visible to external networks. When troubleshooting connectivity issues, it is crucial to distinguish between a service that is down entirely and a service that is running but restricted to a specific network path. To verify which interfaces your SSH daemon is currently listening on, you can use diagnostic tools like ss or netstat. Running sudo ss -tlnp | grep sshd will display the local addresses and ports where the SSH process is accepting connections. If you see an entry like 192.168.1.10:22 instead of *:22 or 0.0.0.0:22, the service is explicitly bound to that single IP address. This confirms that connections to other IPs, even if they belong to another Ethernet card on the same machine, will be rejected at the TCP level.

Checking Firewall Rules

Even if the SSH daemon is configured to listen on all interfaces, firewall software can block incoming connections on specific network segments. Linux systems typically use iptables, nftables, or higher-level wrappers like ufw (Uncomplicated Firewall) or firewalld. These tools operate at the network layer and can filter traffic based on source IP, destination IP, and interface name. If your second Ethernet interface is on a different subnet, you must ensure that the firewall allows inbound TCP traffic on port 22 for that specific interface. For example, using ufw, you might need to run a command like sudo ufw allow in on eth1 to any port 22. With firewalld, you would check if the zone assigned to the second interface has the ssh service enabled. Misconfigured firewall rules are a common cause of intermittent SSH access, especially in environments with dynamic IP assignment or complex routing tables. It is also important to check for reverse path filtering settings in the kernel. If rp_filter is enabled, the kernel may drop packets that do not appear to come from a valid route back to the sender. This can sometimes manifest as dropped SSH handshakes on multi-homed systems. You can inspect these settings via /proc/sys/net/ipv4/conf/all/rp_filter and adjust them if necessary for your network topology.

Modifying the SSH Configuration

The primary configuration file for the OpenSSH server is located at /etc/ssh/sshd_config. To allow SSH connections on all Ethernet interfaces, you should look for the ListenAddress directive. If this line is commented out or absent, the server defaults to listening on all interfaces. If it is present and set to a specific IP, you have two options: comment it out to restore default behavior, or add additional lines for each interface IP you wish to support. For example, adding ListenAddress 0.0.0.0 ensures IPv4 listeners on all interfaces, while ListenAddress :: does the same for IPv6. After making changes, you must restart the SSH service for them to take effect. On systemd-based systems, use sudo systemctl restart sshd. Always test the configuration before restarting to avoid locking yourself out. You can validate the syntax with sudo sshd -t. If the test passes, proceed with the restart. In some cases, you may want to restrict SSH access to specific users or key types on certain interfaces. This can be achieved using Match blocks in the same configuration file. This advanced feature allows you to apply different authentication policies depending on the source IP or interface, providing granular control over remote access security.

Verifying Network Routing and Interfaces

Sometimes the issue is not with the SSH service itself but with the network stack. Ensure that both Ethernet interfaces are up and have valid IP addresses. Use ip addr show to list all network interfaces and their associated IPs. If the second interface shows as DOWN, bring it up with sudo ip link set eth1 up. Additionally, verify that the routing table includes a route for the subnet associated with the second interface. Without a proper route, packets destined for that interface may be dropped or sent to the wrong gateway. For more detailed insights into network connectivity, you might find our guide on How to Log in to Your Router with SSH After Enabling Port Forwarding helpful, as it covers similar concepts regarding network interface accessibility and firewall interactions. Understanding how routers handle multiple interfaces can provide context for why your local machine behaves similarly.

Frequently Asked Questions

Why can I ping the second interface but not SSH?

Pinging uses ICMP protocol, which is often allowed by firewalls even when TCP port 22 is blocked. SSH requires a successful TCP handshake on port 22. Check your firewall rules specifically for TCP traffic on the SSH port for that interface.

Does SSH work over IPv6 on multiple interfaces?

Yes, but you must ensure the SSH daemon is configured to listen on IPv6 addresses. Add ListenAddress :: to your sshd_config file if you want to accept IPv6 connections on all interfaces. Verify that your router is advertising IPv6 prefixes correctly.

Can I use different SSH keys for different interfaces?

Not directly through the interface binding alone. You can use Match Address directives in sshd_config to require specific authorized keys for connections coming from certain IP ranges. This adds a layer of security tailored to the network segment.

What happens if I bind SSH to a non-existent IP?

The SSH daemon will fail to start or log an error indicating that the address is not available. Always verify that the IP address exists on an interface before adding it to the configuration. Use ip addr to confirm current assignments.

How do I test SSH connectivity without logging in?

Use nc -zv 22 to check if the port is open and accepting connections. Alternatively, use telnet 22 to see the SSH banner string returned by the server. These tools help isolate whether the issue is network-related or authentication-related.

Latest News

How to Display Output of xterm Command in Terminal Screen using Cron

Resolve the inability to display xterm output in a terminal screen from cron by redirecting logs or using wall instead of insecure X11 workarounds.

Read More
Expose Local Server on VPS Preserving Real Client IPs (OS Level)

Resolve VPS logging showing only gateway IPs by configuring reverse proxies to forward real client addresses via X-Forwarded-For headers.

Read More
How to Clear Recent Files History in Linux without Deleting Actual Files?

Clear recent files history in Linux by deleting ~/.local/share/recently-used.xbel without removing the actual files.

Read More
Best HDD Copy Strategy: Manually Syncing and Rewriting Scratch

Resolve data drift between two 4TB hard drives by using rsync with the --delete flag to manually sync and rewrite scratch data for an exact mirror.

Read More
Understanding Bash Prompt Abbreviations: An Overview

Resolve repetitive typing errors by creating and persisting Bash aliases in the .bashrc file for improved command-line efficiency.

Read More
Free Tools and Methods to Log Real-Time Performance Details in Task Manager

Log real-time CPU and memory metrics to CSV files using Windows Performance Monitor Data Collector Sets to troubleshoot system slowness.

Read More
Contact Qatar Airways Customer Service: Phone Number, Help Center, and More

Resolve urgent Qatar Airways reservation issues like flight changes and baggage claims using the US phone number +1801-855-5905 or online self-service tools.

Read More
Windows 11: Alt Codes Displaying Wrong Characters - Solutions

Resolve Windows 11 Alt codes showing wrong characters by verifying the US keyboard layout and enabling Num Lock.

Read More
Run Programs with Elevated Privileges: A Comprehensive Guide

Eliminates the need to type sudo for frequent administrative tasks by configuring .bashrc aliases or functions.

Read More
Dynamically Changing Dates in Excel Formulas Using Cells

Eliminate manual date updates in Excel by using cell references to create dynamic formulas that automatically adjust calculations when input dates change.

Read More
Granting Edit Access to a Specific Excel Sheet in an Office 365 User Email ID-Based Login

Excel Online lacks native sheet-level permissions, so users must split workbooks or use worksheet protection to isolate edit access for specific tabs.

Read More
Creating Network Load on Local Wi-Fi from One PC

Generate sustained Wi-Fi bandwidth load from a single PC using a VM SFTP server to test router stability and throughput.

Read More
Changing the Default Editor for Batch Files in Windows 11's File Explorer

Resolve the issue of batch files opening in Notepad by changing the default editor to a preferred application like VS Code.

Read More
Gain WiFi Connection Minutes Before Losing it by Changing MAC Address

Bypass MAC address filtering to restore WiFi connectivity temporarily when a device is blocked by network administrators.

Read More
Photos Folders Turned Black: Troubleshooting Picture Applications on Windows

Resolve black screens in Windows Photos by resetting the app, updating graphics drivers, and repairing system files.

Read More
Troubleshooting High CPU Temperature Values: A Step-by-Step Guide

Resolve high CPU temperatures and thermal throttling by monitoring with Speedfan, cleaning dust from cooling components, and replacing degraded thermal paste.

Read More
Make cURL establish TLS connection with CA unknown

Resolve cURL TLS connection failures with unknown or self-signed certificates by using the --insecure flag to bypass CA validation.

Read More
Troubleshooting Incorrect Network Metrics Values in Grafana, Prometheus, InfluxDB, and Telegraf

Fix incorrect network metrics in Grafana, Prometheus, InfluxDB, and Telegraf by verifying interface selection, resolving unit mismatches, and handling counter resets.

Read More
Start Another Terminal Window (cmd.exe) Windows Repair/Troubleshoot

Provides step-by-step instructions to access the Windows Command Prompt via bootable media for advanced system repair and troubleshooting.

Read More
Thinkpad P1 Gen 6: Sudden Thunderbolt 3 Dock USB-C Charging Stopped Working

Resolve sudden Thunderbolt 3 dock USB-C charging and internet failure on ThinkPad P1 Gen 6 by updating firmware, resetting the dock, and adjusting power settings.

Read More
ASUS Windows 11 Laptop: Internet Connection Issue with Hotspot

Resolve ASUS Windows 11 laptop spinning wheel issue when connecting to mobile hotspot by resetting network stack, disabling IPv6, and adjusting power settings.

Read More
Developing iOS Project with Firebase: Logging in and Sending Push Notifications

Integrates Firebase to enable secure user authentication and push notifications in iOS applications.

Read More
Troubleshooting Bash Script with Suspected Issues of Spaces, Dashes, Filenames and Quoting

Resolve Bash script failures caused by word splitting, globbing, and special characters in filenames by applying proper quoting techniques.

Read More
Populating OneDrive Folder for Local Backup without Affecting Remote Files

Prevent OneDrive from deleting remote files during Windows reinstallation by unlinking the account or using symbolic links to isolate local data.

Read More
Force First Frame as Keyframe Without Re-encoding: A Quick Solution

Resolve inaccurate seeking and playback glitches by re-encoding video to ensure the first frame is a valid keyframe.

Read More
Find Information in Database Using WSL (Ubuntu) on Windows-10

Resolve database connection issues from WSL Ubuntu on Windows 10 by configuring client tools and network access to query remote or local servers.

Read More
Configuring a New Router with Different Networks: One Family, One Guest

Resolve IP conflicts and isolate guest traffic by configuring a second router with a distinct subnet via its WAN port.

Read More
Quickly Open Multiple Stock Websites with a Single Command

Solve the problem of manually opening multiple stock research websites by creating a single command to launch them simultaneously on Windows, macOS, or Linux.

Read More
Improved Adobe Acrobat Search Experience: Access Advanced Search with Ease

Access advanced search filters like case sensitivity and regex in Adobe Acrobat by clicking More Options in the Find bar.

Read More
Port Forwarding VM via OpenVPN: A Comprehensive Guide

Configure OpenVPN server and iptables to forward specific ports from VPN clients to a virtual machine's internal IP address.

Read More
Understanding Partitions in the 1980s: A Look Back at MS-DOS and Master Boot Record

Explains how the Master Boot Record and partition table enabled MS-DOS to manage multiple disk volumes on a single physical drive.

Read More
Windows 10 Enterprise: Keyboard Not Detected in Managed Organization with Admin Privileges

Resolve Windows 10 Enterprise keyboard detection failures caused by Group Policy restrictions, driver corruption, or USB enumeration errors.

Read More
Can't Find x86_64 Versions of Applications on MacOS arm64 (M1)

Resolve missing x86_64 app issues on M1 Macs by installing Rosetta 2 and reinstalling apps as universal binaries.

Read More
How to Hide Installation Source for an Android App

Manage Android app installation source visibility by using USB transfers or file managers to reduce browser traces and isolate data via work profiles.

Read More
Connecting Momentus 4200.2 ST9808210A Hard Drive via USB Cable

Resolve inability to access Seagate Momentus 4200.2 ST9808210A hard drive by connecting it via USB using a compatible SATA-to-USB adapter and configuring the disk in Windows.

Read More