External SSH

From DD-WRT Wiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 03:28, 28 June 2006 (edit)
68.37.19.212 (Talk)
(Warning!)
← Previous diff
Revision as of 03:31, 28 June 2006 (edit) (undo)
68.37.19.212 (Talk)
(Warning!)
Next diff →
Line 14: Line 14:
=Warning!= =Warning!=
'''It's not too secure to set up SSH access like that. Be sure to choose a long and secure password or even better use [[Telnet/SSH_and_the_Command_Line#Setting_Up_2|Public Key Method]]. Otherwise someone could succeed to hack your router by a [http://en.wikipedia.org/wiki/Brute_force_attack Brute Force Attack].''' '''It's not too secure to set up SSH access like that. Be sure to choose a long and secure password or even better use [[Telnet/SSH_and_the_Command_Line#Setting_Up_2|Public Key Method]]. Otherwise someone could succeed to hack your router by a [http://en.wikipedia.org/wiki/Brute_force_attack Brute Force Attack].'''
- 
- 
[[Category:basic HOWTO]] [[Category:basic HOWTO]]
-The above method is obsolete at this time. You should only now need to go to Administration->Management->Remote Access->SSH Management and enable it, specifying the port you wish to enable WAN access to.+'''The above method is obsolete at this time:''' You should only now need to go to Administration->Management->Remote Access->SSH Management and enable it, specifying the port you wish to enable WAN access to.
[[Category:English documentation]] [[Category:English documentation]]

Revision as of 03:31, 28 June 2006

How to set up SSH access from internet

To make it possible to access your router from internet by SSH follow these steps:

  • Enable SSHD on the Web_Interface (Administration -> Management or Services) and don't forget to Save Settings.
  • Recommend also to change the SSHD port to something non-standard above 1024. The reason for this is, there are MANY brute-force attack tools out there that scan ranges of IP looking on port 22. If they see a response they do a brute-force attempt with a list of passwords. If your password is "admin" you are likely to be in trouble. Easy way to avoid being on their radar is CHANGE THIS DEFAULT PORT.
  • To allow access to the SSH port from WAN add the following rule as command on the Web_Interface (Administration -> Diagnostics) and save with Save Firewall:
/usr/sbin/iptables -I INPUT 1 -p tcp --dport $(nvram get sshd_port) -j logaccept
  • To log into your router from a windows machine you could use Putty. You will have to enter the external ip of your router or the DynDNS name to login from Internet. If you have changed the port on which sshd runs, you will have to fill in that port number.
  • To disable the access from Internet:
 /usr/sbin/iptables -D INPUT 1

Warning!

It's not too secure to set up SSH access like that. Be sure to choose a long and secure password or even better use Public Key Method. Otherwise someone could succeed to hack your router by a Brute Force Attack.

The above method is obsolete at this time: You should only now need to go to Administration->Management->Remote Access->SSH Management and enable it, specifying the port you wish to enable WAN access to.