Search blogs
Did you find a problem ? Tell us about it! Get a blog Report blog Random blog

How to change the default 22 SSH port on OpenWRT routers

Posted on 23/06/2006

Here's a simple way to "change" the default SSH port for WAN (the internet) on OpenWRT routers. Let's access SSH from port 23000 for example.
Add the folowing lines to /etc/firewall.user

# SSH port 22 closed from WAN
iptables -A INPUT -i $WAN -p tcp --dport 22 -d 192.168.1.1 -j DROP


# SSH open on port 23000
iptables -t nat -A prerouting_rule -i $WAN -p tcp --dport 23000 -j DNAT --to-destination 192.168.1.1:22
iptables -t filter -A input_rule -i $WAN -p TCP --dport 22 -d 192.168.1.1 -j ACCEPT
Tags: openwrt , ssh , router , firewall
These icons link to social bookmarking sites where readers can share and discover new web pages. Bookmark page
  • digg
  • del.icio.us
  • YahooMyWeb
  • Furl
  • Fark
  • Ma.gnolia
  • Reddit
  • Smarking
  • Spurl
  • NewsVine
  • blinkbits
  • Yahoo Messenger
Razvan @ 15:33
Filed under: stuff

1 Comment for 'How to change the default 22 SSH port on OpenWRT routers' »

  1.  
    zang
    February 19 2007 | 23:25
     
    Super ce zice acolo... merci ;)

No trackbacks have been added to this post yet.

Leave a comment





Human test

Information for comment users
Your e-mail address is never displayed. Please consider what you're posting.