互联网 SSH 访问

From DD-WRT Wiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 10:58, 22 May 2010 (edit)
Amoroso1860 (Talk | contribs)
(New page: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"...)
← Previous diff
Current revision (12:03, 7 November 2010) (edit) (undo)
Wufangzhuo (Talk | contribs)

 
(5 intermediate revisions not shown.)
Line 1: Line 1:
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">+{{Languages|External SSH}}
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">+SSH access from Internet
- + 
-<head>+==Ensure SSH Enabled==
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />+# Goto the ''Services'' tab and the ''Services'' sub-tab on the [[Web Interface]]
- <meta name="keywords" content="External SSH,Web Interface" />+# Enable "SSHd" is under the section titled "Secure Shell"
- <link rel="shortcut icon" href="/favicon.ico" />+# 'SSH TCP Forwarding' does not need to be enabled if you just want to connect from the outside to your LAN.
- <link rel="search" type="application/opensearchdescription+xml" href="/wiki/opensearch_desc.php" title="DD-WRT Wiki (English)" />+# 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)
- <link title="Creative Commons" type="application/rdf+xml" href="/wiki/index.php?title=External_SSH&amp;action=creativecommons" rel="meta" />+# 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]].
- <link rel="copyright" href="http://www.gnu.org/copyleft/fdl.html" />+# Save
- <title>External SSH - DD-WRT Wiki</title>+ 
- <style type="text/css" media="screen,projection">/*<![CDATA[*/ @import "/wiki/skins/sgumax/gumax_main.css?63"; /*]]>*/</style>+==Enable Remote Access==
- <link rel="stylesheet" type="text/css" media="print" href="/wiki/skins/common/commonPrint.css?63" />+# Goto the ''Administration'' tab and the ''Management'' sub-tab on the [[Web Interface]]
- <link rel="stylesheet" type="text/css" media="handheld" href="/wiki/skins/sgumax/handheld.css?63" />+# Enable "SSH Management" under the section titled "Remote Access"
- <!--[if lt IE 5.5000]><style type="text/css">@import "/wiki/skins/sgumax/IE50Fixes.css?63";</style><![endif]-->+# Enter the same port number as specified under (4) above. This opens the port in the firewall.
- <!--[if IE 5.5000]><style type="text/css">@import "/wiki/skins/sgumax/IE55Fixes.css?63";</style><![endif]-->+# Save
- <!--[if IE 6]><style type="text/css">@import "/wiki/skins/sgumax/IE60Fixes.css?63";</style><![endif]-->+# Reboot Router
- <!--[if IE 7]><style type="text/css">@import "/wiki/skins/sgumax/IE70Fixes.css?63";</style><![endif]-->+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].
- <!--[if lt IE 7]><script type="text/javascript" src="/wiki/skins/common/IEFixes.js?63"></script>+ 
- <meta http-equiv="imagetoolbar" content="no" /><![endif]-->+==Disabling Remote Access==
- +If at any time you wish to disable SSH access from the WAN,
- <script type= "text/javascript">/*<![CDATA[*/+# Goto the ''Administration'' tab and the ''Management'' sub-tab on the [[Web Interface]]
-var skin = "sgumax";+# Disable "SSH Management" under the section titled "Remote Access"
-var stylepath = "/wiki/skins";+# Apply Settings
-var wgArticlePath = "/wiki/index.php/$1";+ 
-var wgScriptPath = "/wiki";+==SSH Password==
-var wgServer = "http://www.dd-wrt.com";+# When asked for the '''username''', enter '''root''' (even if you changed username in web interface)
-var wgCanonicalNamespace = "";+# When asked for the '''password''', enter your router's password
-var wgCanonicalSpecialPageName = false;+ 
-var wgNamespaceNumber = 0;+=References=
-var wgPageName = "External_SSH";+* http://hetos.de/sshtut.html
-var wgTitle = "External SSH";+ 
-var wgAction = "view";+[[Category:SSH]]
-var wgArticleId = "1038";+[[Category:Basic tutorials]]
-var wgIsArticle = true;+
-var wgUserName = "Amoroso1860";+
-var wgUserGroups = ["*", "user", "autoconfirmed"];+
-var wgUserLanguage = "en";+
-var wgContentLanguage = "en";+
-var wgBreakFrames = false;+
-var wgCurRevisionId = "31674";+
-/*]]>*/</script>+
- +
- <script type="text/javascript" src="/wiki/skins/common/wikibits.js?63"><!-- wikibits js --></script>+
- <script type="text/javascript" src="/wiki/index.php?title=-&amp;action=raw&amp;smaxage=0&amp;gen=js"><!-- site js --></script>+
- <style type="text/css">/*<![CDATA[*/+
-@import "/wiki/index.php?title=MediaWiki:Common.css&usemsgcache=yes&action=raw&ctype=text/css&smaxage=18000";+
-@import "/wiki/index.php?title=MediaWiki:Sgumax.css&usemsgcache=yes&action=raw&ctype=text/css&smaxage=18000";+
-@import "/wiki/index.php?title=-&action=raw&gen=css&maxage=18000&smaxage=0";+
-/*]]>*/</style>+
- <!-- Head Scripts -->+
- <script type="text/javascript" src="/wiki/skins/common/ajax.js?63"></script>+
- <script type="text/javascript" src="/wiki/skins/common/ajaxsearch.js?63"></script>+
- <script type="text/javascript">hookEvent("load", sajax_onload);</script>+
-</head>+
- +
-<body class="mediawiki ns-0 ltr page-External_SSH">+
- +
- <!-- =================== gumax-page =================== -->+
- <div id="gumax-page">+
- +
- <!-- Header -->+
- <div id="gumax-header">+
- <a name="top" id="contentTop"></a>+
- +
- <!-- Site Logo -->+
- <div id="gumax-p-logo">+
- <a style="background-image: url(http://www.dd-wrt.com/wiki/DD_WRT_black.jpg);" href="/wiki/index.php/Main_Page" title="Main Page"></a>+
- </div>+
- <!-- end of Site Logo -->+
- +
- <!-- Login -->+
- <div id="gumax-p-login">+
- <ul>+
- <li id="gumax-pt-userpage"><a href="/wiki/index.php/User:Amoroso1860" class="new">Amoroso1860</a>+
- |</li>+
- <li id="gumax-pt-mytalk"><a href="/wiki/index.php/User_talk:Amoroso1860" class="new">My talk</a>+
- |</li>+
- <li id="gumax-pt-preferences"><a href="/wiki/index.php/Special:Preferences">My preferences</a>+
- |</li>+
- <li id="gumax-pt-watchlist"><a href="/wiki/index.php/Special:Watchlist">My watchlist</a>+
- |</li>+
- <li id="gumax-pt-mycontris"><a href="/wiki/index.php/Special:Contributions/Amoroso1860">My contributions</a>+
- |</li>+
- <li id="gumax-pt-logout"><a href="/wiki/index.php?title=Special:Userlogout&amp;returnto=External_SSH">Log out</a>+
- </li>+
- </ul>+
- </div> <!-- end of gumax-p-login DIV -->+
- <!-- end of Login -->+
- +
- <!-- Search -->+
- <div id="gumax-p-search" class="gumax-portlet">+
- <div id="gumax-searchBody" class="gumax-pBody">+
- <form action="/wiki/index.php/Special:Search" id="searchform"><div>+
- <input id="searchInput" name="search" type="text" accesskey="f" value="" />+
- +
- <input type='submit' name="go" class="searchButton" id="searchGoButton" value="Go" />+
- +
- </div></form>+
- </div>+
- </div> <!-- end of gumax-p-search DIV -->+
- <!-- end of Search -->+
- +
- <!-- Navigation Menu -->+
- <div id="gumax-p-navigation-wrapper">+
- <div id="gumax-p-navigation">+
- <ul>+
- <li id="n-mainpage">+
- <a href="/wiki/index.php/Main_Page">Main Page</a>+
- <!--|--></li>+
- <li id="n-portal">+
- <a href="/wiki/index.php/DD-WRT_Wiki:Community_Portal">Community portal</a>+
- <!--|--></li>+
- <li id="n-currentevents">+
- <a href="/wiki/index.php/Current_events">Current events</a>+
- <!--|--></li>+
- <li id="n-recentchanges">+
- <a href="/wiki/index.php/Special:Recentchanges">Recent changes</a>+
- <!--|--></li>+
- <li id="n-randompage">+
- <a href="/wiki/index.php/Special:Random">Random page</a>+
- <!--|--></li>+
- <li id="n-help">+
- <a href="/wiki/index.php/Help:Contents">Help</a>+
- <!--|--></li>+
- <li id="n-sitesupport">+
- <a href="/wiki/index.php/DD-WRT_Wiki:Site_support">Donations</a>+
- <!----></li>+
- </ul>+
- </div>+
- </div>+
- <!-- end of Navigation Menu -->+
- +
- </div> <!-- end of header DIV -->+
- <!-- end of Header -->+
- +
- <!-- Main Content -->+
- <div id="content">+
- <a name="top" id="top"></a>+
- <h1 class="firstHeading">External SSH</h1>+
- <div id= "bodyContent" class="gumax-bodyContent">+
- <h3 id="siteSub">From DD-WRT Wiki</h3>+
- <div id="contentSub">(Redirected from <a href="/wiki/index.php?title=SSH_access_from_internet&amp;redirect=no" title="SSH access from internet">SSH access from internet</a>)</div>+
- <div id="jump-to-nav">Jump to: <a href="#column-one">navigation</a>, <a href="#searchInput">search</a></div> <!-- start content -->+
- <p>SSH access from Internet+
-</p>+
-<table id="toc" class="toc" summary="Contents"><tr><td><div id="toctitle"><h2>Contents</h2></div>+
-<ul>+
-<li class="toclevel-1"><a href="#Ensure_SSH_Enabled"><span class="tocnumber">1</span> <span class="toctext">Ensure SSH Enabled</span></a></li>+
-<li class="toclevel-1"><a href="#Enable_Remote_Access"><span class="tocnumber">2</span> <span class="toctext">Enable Remote Access</span></a></li>+
-<li class="toclevel-1"><a href="#Disabling_Remote_Access"><span class="tocnumber">3</span> <span class="toctext">Disabling Remote Access</span></a></li>+
-<li class="toclevel-1"><a href="#SSH_Password"><span class="tocnumber">4</span> <span class="toctext">SSH Password</span></a></li>+
-<li class="toclevel-1"><a href="#References"><span class="tocnumber">5</span> <span class="toctext">References</span></a></li>+
-</ul>+
-</td></tr></table><script type="text/javascript"> if (window.showTocToggle) { var tocShowText = "show"; var tocHideText = "hide"; showTocToggle(); } </script>+
-<a name="Ensure_SSH_Enabled"></a><h2><span class="editsection">[<a href="/wiki/index.php?title=External_SSH&amp;action=edit&amp;section=1" title="Edit section: Ensure SSH Enabled">edit</a>]</span> <span class="mw-headline">Ensure SSH Enabled</span></h2>+
-<ol><li> Goto the <i>Services</i> tab and the <i>Services</i> sub-tab on the <a href="/wiki/index.php/Web_Interface" title="Web Interface">Web Interface</a>+
-</li><li> Enable "SSHd" is under the section titled "Secure Shell"+
-</li><li> 'SSH TCP Forwarding' does not need to be enabled if you just want to connect from the outside to your LAN.+
-</li><li> 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)+
-</li><li> You can activate (less secure) password authorization and/or (recommended) private/public key authorization. More information about generating the keys can be found here: [<a href="http://www.dd-wrt.com/wiki/index.php/Telnet/SSH_and_the_Command_Line#Setting_Up" class="external autonumber" title="http://www.dd-wrt.com/wiki/index.php/Telnet/SSH_and_the_Command_Line#Setting_Up" rel="nofollow">[1]</a>].+
-</li><li> Save+
-</li></ol>+
-<a name="Enable_Remote_Access"></a><h2><span class="editsection">[<a href="/wiki/index.php?title=External_SSH&amp;action=edit&amp;section=2" title="Edit section: Enable Remote Access">edit</a>]</span> <span class="mw-headline">Enable Remote Access</span></h2>+
-<ol><li> Goto the <i>Administration</i> tab and the <i>Management</i> sub-tab on the <a href="/wiki/index.php/Web_Interface" title="Web Interface">Web Interface</a>+
-</li><li> Enable "SSH Management" under the section titled "Remote Access"+
-</li><li> Enter the same port number as specified under (4) above. This opens the port in the firewall.+
-</li><li> Save+
-</li><li> 重新启动路由器+
-</li></ol>+
-<p>Now you will be able to connect to your router's WAN IP from the internet using an SSH client such as <a href="http://www.chiark.greenend.org.uk/~sgtatham/putty/" class="external text" title="http://www.chiark.greenend.org.uk/~sgtatham/putty/" rel="nofollow">PuTTY</a>.+
-</p>+
-<a name="Disabling_Remote_Access"></a><h2><span class="editsection">[<a href="/wiki/index.php?title=External_SSH&amp;action=edit&amp;section=3" title="Edit section: Disabling Remote Access">edit</a>]</span> <span class="mw-headline">Disabling Remote Access</span></h2>+
-<p>If at any time you wish to disable SSH access from the WAN,+
-</p>+
-<ol><li> Goto the <i>Administration</i> tab and the <i>Management</i> sub-tab on the <a href="/wiki/index.php/Web_Interface" title="Web Interface">Web Interface</a>+
-</li><li> Disable "SSH Management" under the section titled "Remote Access"+
-</li><li> Apply Settings+
-</li></ol>+
-<a name="SSH_Password"></a><h2><span class="editsection">[<a href="/wiki/index.php?title=External_SSH&amp;action=edit&amp;section=4" title="Edit section: SSH Password">edit</a>]</span> <span class="mw-headline">SSH Password</span></h2>+
-<ol><li> When asked for the <b>username</b>, enter <b>root</b> (even if you changed username in web interface)+
-</li><li> When asked for the <b>password</b>, enter your router's password+
-</li></ol>+
-<a name="References"></a><h1><span class="editsection">[<a href="/wiki/index.php?title=External_SSH&amp;action=edit&amp;section=5" title="Edit section: References">edit</a>]</span> <span class="mw-headline">References</span></h1>+
-<ul><li> <a href="http://hetos.de/sshtut.html" class="external free" title="http://hetos.de/sshtut.html" rel="nofollow">http://hetos.de/sshtut.html</a>+
-</li></ul>+
- +
-<!-- Saved in parser cache with key wiki_ddwrt-mw_:pcache:idhash:1038-0!1!0!!en!2 and timestamp 20100521210542 -->+
-<div class="printfooter">+
-Retrieved from "<a href="http://www.dd-wrt.com/wiki/index.php/External_SSH">http://www.dd-wrt.com/wiki/index.php/External_SSH</a>"</div>+
- <div id="catlinks"><p class='catlinks'><a href="/wiki/index.php/Special:Categories" title="Special:Categories">Categories</a>: <span dir='ltr'><a href="/wiki/index.php/Category:SSH" title="Category:SSH">SSH</a></span> | <span dir='ltr'><a href="/wiki/index.php/Category:Basic_tutorials" title="Category:Basic tutorials">Basic tutorials</a></span></p></div> <!-- end content -->+
- <!-- show back to top link only if the body is longer than the window height -->+
- <script type="text/javascript">+
- var winheight = parseInt(document.documentElement.clientHeight)+
- var boheight = parseInt(document.body.scrollHeight)+
- if(winheight <= boheight) {+
- document.write('<div class="backToTop"><a href="#" onclick="window.scrollTo(0,0);return false;" title="Back to the top of the page">&nbsp;</a></div>');+
- }+
- </script>+
- <div class="visualClear"></div>+
- </div>+
- </div> <!-- end of gumax-content DIV -->+
- <!-- end of Main Content -->+
- +
- </div> <!-- end of gumax-page DIV -->+
- <!-- =================== end of gumax-page =================== -->+
- +
- <!-- =================== gumax-page-actions =================== -->+
- <!-- gumax-page-actions -->+
- <div id="gumax-page-actions">+
- <div id="gumax-content-actions">+
- <ul>+
- <li id="ca-nstab-main"+
- class="selected" ><a href="/wiki/index.php/External_SSH">Article</a>+
- |</li>+
- <li id="ca-talk"+
- ><a href="/wiki/index.php/Talk:External_SSH">Discussion</a>+
- |</li>+
- <li id="ca-edit"+
- ><a href="/wiki/index.php?title=External_SSH&amp;action=edit">Edit</a>+
- |</li>+
- <li id="ca-history"+
- ><a href="/wiki/index.php?title=External_SSH&amp;action=history">History</a>+
- |</li>+
- <li id="ca-move"+
- ><a href="/wiki/index.php/Special:Movepage/External_SSH">Move</a>+
- |</li>+
- <li id="ca-watch"+
- ><a href="/wiki/index.php?title=External_SSH&amp;action=watch">Watch</a>+
- </li>+
- </ul>+
- </div>+
- </div> <!-- end of gumax-page-actions DIV -->+
- <!-- =================== end of gumax-page-actions =================== -->+
- +
- <!-- =================== gumax-page-footer =================== -->+
- <div id="gumax-page-footer">+
- +
- <!-- personal tools -->+
- <div id="gumax-personal-tools">+
- <ul>+
- <li id="t-whatlinkshere"><a href="/wiki/index.php/Special:Whatlinkshere/External_SSH">What links here</a> | </li>+
- <li id="t-recentchangeslinked"><a href="/wiki/index.php/Special:Recentchangeslinked/External_SSH">Related changes</a> | </li>+
- <li id="t-upload"><a href="/wiki/index.php/Special:Upload">Upload file</a>+
- |</li>+
- <li id="t-specialpages"><a href="/wiki/index.php/Special:Specialpages">Special pages</a>+
- </li>+
- <li id="t-permalink"> | <a href="/wiki/index.php?title=External_SSH&amp;oldid=31674">Permanent link</a></li><li id="t-pdf"><a href="/wiki/index.php?title=Special:PdfPrint&amp;page=External_SSH">Print as PDF</a></li>+
- </ul>+
- </div> <!-- end of personal-tools DIV -->+
- <!-- end of personal tools -->+
- +
- <!-- gumax-footer -->+
- <div id="gumax-footer">+
- <div id="gumax-f-message">+
- <span id="f-lastmod"> This page was last modified 13:56, 30 April 2010.</span> <span id="f-viewcount">This page has been accessed 136,630 times. </span> </div>+
- <ul id="gumax-f-list">+
- <li id="f-about"><a href="/wiki/index.php/DD-WRT_Wiki:About" title="DD-WRT Wiki:About">About DD-WRT Wiki</a> | </li> <li id="f-disclaimer"><a href="/wiki/index.php/DD-WRT_Wiki:General_disclaimer" title="DD-WRT Wiki:General disclaimer">Disclaimers</a> | </li> <li><a href="http://mediawiki.org">Powered by MediaWiki</a> | </li>+
- <li><a href="http://paulgu.com">Design by Paul Gu</a></li>+
- </ul>+
- </div> <!-- end of gumax-footer DIV -->+
- <!-- end of gumax-footer -->+
- +
- +
- <script type="text/javascript">if (window.runOnloadHook) runOnloadHook();</script>+
- +
- </div> <!-- end of gumax-page-footer DIV -->+
- <!-- =================== end of gumax-page-footer =================== -->+
- +
- <!-- Served by wwwn.dd-wrt.com in 0.156 secs. -->+
-</body></html>+

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