Enable remote SSH access on OpenWRT

Enabling remote SSH access in OpenWRT is a two-step process. SSH access must be enabled on the WAN, and the SSH port must be opened in the firewall.
1. Enable ssh access on the WAN Go to System->Administration. Under SSH Access, make sure "unspecified" is selected for Interface. This allows SSH access on both the LAN and WAN interfaces.
2. Now, open the appropriate port in your firewall. There are two ways to accomplish this. You can either add changes to /etc/firewall.user or /etc/config/firewall.

A. To use the first method, add the following lines to /etc/firewall.user. Note the example below specifies port 22 as the SSH port.
iptables -t nat -A prerouting_wan -p tcp --dport 22 -j ACCEPT iptables -A input_wan -p tcp --dport 22 -j ACCEPT

B. To use the second method, add the following to /etc/config/firewall. Note the example below specifies port 22 as the SSH port.

config rule
    option name 'WAN-MGMT-22'
    option src wan
    option dest_port 22
    option target ACCEPT
    option proto tcp
 
config rule
    option name 'WAN-MGMT-80'
    option src 'wan'
    option dest_port '80'
    option target 'ACCEPT'
    option proto tcp

AUST IT - Computer help out of hours, when you need it most.

Find out why we do it for less.

About

AUST IT will help you resolve any technical support issues you are facing onsite or remotely via remote desktop 24/7. More...

Contacts

Reservoir, Melbourne,
3073, VIC, Australia

Phone: 0422 348 882

This email address is being protected from spambots. You need JavaScript enabled to view it.

Sydney: 0481 837 077

Connect

Join us in social networks to be in touch.

Newsletter

Complete the form below, and we'll send you our emails with all the latest AUST IT news.