External SSH

From DD-WRT Wiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 02:58, 29 August 2006 (edit)
AlReece45 (Talk | contribs)
(Tidy up)
← Previous diff
Current revision (18:50, 22 May 2010) (edit) (undo)
Glenn (Talk | contribs)
(+{{Languages|External SSH}})
 
(14 intermediate revisions not shown.)
Line 1: Line 1:
-= Setup SSH access from Internet =+{{Languages|External SSH}}
 +SSH access from Internet
-== DD-WRT v23 SP1 or later ==+==Ensure SSH Enabled==
- +# Goto the ''Services'' tab and the ''Services'' sub-tab on the [[Web Interface]]
-=== Ensure SSH Enabled ===+
- +
-# Goto the ''Administration'' tab and the ''Services'' sub-tab on the [[Web_Interface]]+
# Enable "SSHd" is under the section titled "Secure Shell" # Enable "SSHd" is under the section titled "Secure Shell"
-# Choose an appropriate port (The default is 22, but is recommended you change to a non-standard port above 1024 because of security)+# 'SSH TCP Forwarding' does not need to be enabled if you just want to connect from the outside to your LAN.
-# Apply Settings if needed+# Choose an appropriate port (The default is 22, but it is recommended that you change it to a non-standard port above 1024 for security reasons. Remember the port number, as you will need to enter it into your SSH client in order to connect to the router)
 +# You can activate (less secure) password authorization and/or (recommended) private/public key authorization. More information about generating the keys can be found here: [[http://www.dd-wrt.com/wiki/index.php/Telnet/SSH_and_the_Command_Line#Setting_Up]].
 +# Save
-''REFERENCES:'' [[Telnet/SSH_and_the_Command_Line#SSH]] or Sections 1.1 and 1.2 of [http://hetos.de/sshtut.html]+==Enable Remote Access==
- +# Goto the ''Administration'' tab and the ''Management'' sub-tab on the [[Web Interface]]
-=== Enable Remote Access ===+
- +
-# Goto the ''Administration'' tab and the ''Management'' sub-tab on the [[Web_Interface]]+
# Enable "SSH Management" under the section titled "Remote Access" # Enable "SSH Management" under the section titled "Remote Access"
-# Apply Settings+# Enter the same port number as specified under (4) above. This opens the port in the firewall.
 +# Save
 +# Reboot Router
 +Now you will be able to connect to your router's WAN IP from the internet using an SSH client such as [http://www.chiark.greenend.org.uk/~sgtatham/putty/ PuTTY].
-=== Disabling Remote Access ===+==Disabling Remote Access==
- +If at any time you wish to disable SSH access from the WAN,
-# Goto the ''Administration'' tab and the ''Management'' sub-tab on the [[Web_Interface]]+# Goto the ''Administration'' tab and the ''Management'' sub-tab on the [[Web Interface]]
# Disable "SSH Management" under the section titled "Remote Access" # Disable "SSH Management" under the section titled "Remote Access"
# Apply Settings # Apply Settings
-== DD-WRT v23 or Earlier ==+==SSH Password==
- +# When asked for the '''username''', enter '''root''' (even if you changed username in web interface)
-=== Ensure SSH Enabled ===+# When asked for the '''password''', enter your router's password
- +
-# Goto the ''Administration'' tab and the ''Services'' sub-tab on the [[Web_Interface]]+
-# Enable "SSHd" is under the section titled "Secure Shell"+
-# Choose an appropriate port (The default is 22, but is recommended you change to a non-standard port above 1024 because of security)+
-# Apply Settings if needed+
- +
-''REFERENCES:'' [[Telnet/SSH_and_the_Command_Line#SSH]] or Sections 1.1 and 1.2 of [http://hetos.de/sshtut.html]+
- +
-=== Enable Remote Access ===+
- +
-# Goto the ''Administration'' tab and the ''Diagnostics'' sub-tab.+
-# Add the following to the text area:+
- +
- /usr/sbin/iptables -I INPUT -p tcp --dport $(nvram get sshd_port) -j logaccept+
- +
-# Save as Firewall Script+
- +
-=== Disabling Remote Access ===+
- +
-# Goto the ''Administration'' tab and the ''Diagnostics'' sub-tab.+
-# Add the following to the text area:+
- +
- /usr/sbin/iptables -D INPUT 1+
- +
-# Save as Firewall Script+
- +
-=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].'''+
-[[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.+=References=
 +* http://hetos.de/sshtut.html
-[[Category:English documentation]]+[[Category:SSH]]
 +[[Category:Basic tutorials]]

Current revision

SSH access from Internet

Contents

[edit] Ensure SSH Enabled

  1. Goto the Services tab and the Services sub-tab on the Web Interface
  2. Enable "SSHd" is under the section titled "Secure Shell"
  3. 'SSH TCP Forwarding' does not need to be enabled if you just want to connect from the outside to your LAN.
  4. Choose an appropriate port (The default is 22, but it is recommended that you change it to a non-standard port above 1024 for security reasons. Remember the port number, as you will need to enter it into your SSH client in order to connect to the router)
  5. You can activate (less secure) password authorization and/or (recommended) private/public key authorization. More information about generating the keys can be found here: [[1]].
  6. Save

[edit] Enable Remote Access

  1. Goto the Administration tab and the Management sub-tab on the Web Interface
  2. Enable "SSH Management" under the section titled "Remote Access"
  3. Enter the same port number as specified under (4) above. This opens the port in the firewall.
  4. Save
  5. Reboot Router

Now you will be able to connect to your router's WAN IP from the internet using an SSH client such as PuTTY.

[edit] Disabling Remote Access

If at any time you wish to disable SSH access from the WAN,

  1. Goto the Administration tab and the Management sub-tab on the Web Interface
  2. Disable "SSH Management" under the section titled "Remote Access"
  3. Apply Settings

[edit] SSH Password

  1. When asked for the username, enter root (even if you changed username in web interface)
  2. When asked for the password, enter your router's password

[edit] References