互联网 SSH 访问

From DD-WRT Wiki

Revision as of 10:58, 22 May 2010 by Amoroso1860 (Talk | contribs)
(diff) ←Older revision | Current revision (diff) | Newer revision→ (diff)
Jump to: navigation, search

<!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" dir="ltr">

<head>

   <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
   		<meta name="keywords" content="External SSH,Web Interface" />

<link rel="shortcut icon" href="/favicon.ico" /> <link rel="search" type="application/opensearchdescription+xml" href="/wiki/opensearch_desc.php" title="DD-WRT Wiki (English)" /> <link title="Creative Commons" type="application/rdf+xml" href="/wiki/index.php?title=External_SSH&action=creativecommons" rel="meta" /> <link rel="copyright" href="http://www.gnu.org/copyleft/fdl.html" />

   <title>External SSH - DD-WRT Wiki</title>
   <style type="text/css" media="screen,projection">/*<![CDATA[*/ @import "/wiki/skins/sgumax/gumax_main.css?63"; /*]]>*/</style>
   <link rel="stylesheet" type="text/css" media="print" href="/wiki/skins/common/commonPrint.css?63" />
   <link rel="stylesheet" type="text/css" media="handheld" href="/wiki/skins/sgumax/handheld.css?63" />

   <script type= "text/javascript">/*<![CDATA[*/

var skin = "sgumax"; var stylepath = "/wiki/skins"; var wgArticlePath = "/wiki/index.php/$1"; var wgScriptPath = "/wiki"; var wgServer = "http://www.dd-wrt.com"; var wgCanonicalNamespace = ""; var wgCanonicalSpecialPageName = false; var wgNamespaceNumber = 0; var wgPageName = "External_SSH"; var wgTitle = "External SSH"; var wgAction = "view"; var wgArticleId = "1038"; 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"></script>
           <script type="text/javascript" src="/wiki/index.php?title=-&action=raw&smaxage=0&gen=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>

   		<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">

       <a name="top" id="contentTop"></a>

  • <a href="/wiki/index.php/User:Amoroso1860" class="new">Amoroso1860</a> |
  • <a href="/wiki/index.php/User_talk:Amoroso1860" class="new">My talk</a> |
  • <a href="/wiki/index.php/Special:Preferences">My preferences</a> |
  • <a href="/wiki/index.php/Special:Watchlist">My watchlist</a> |
  • <a href="/wiki/index.php/Special:Contributions/Amoroso1860">My contributions</a> |
  • <a href="/wiki/index.php?title=Special:Userlogout&returnto=External_SSH">Log out</a>
  • <a href="/wiki/index.php/Main_Page">Main Page</a>
  • <a href="/wiki/index.php/DD-WRT_Wiki:Community_Portal">Community portal</a>
  • <a href="/wiki/index.php/Current_events">Current events</a>
  • <a href="/wiki/index.php/Special:Recentchanges">Recent changes</a>
  • <a href="/wiki/index.php/Special:Random">Random page</a>
  • <a href="/wiki/index.php/Help:Contents">Help</a>
  • <a href="/wiki/index.php/DD-WRT_Wiki:Site_support">Donations</a>
       <a name="top" id="top"></a>

Contents

External SSH

From DD-WRT Wiki

(Redirected from <a href="/wiki/index.php?title=SSH_access_from_internet&redirect=no" title="SSH access from internet">SSH access from internet</a>)
Jump to: <a href="#column-one">navigation</a>, <a href="#searchInput">search</a>

SSH access from Internet

Contents

  • <a href="#Ensure_SSH_Enabled">1 Ensure SSH Enabled</a>
  • <a href="#Enable_Remote_Access">2 Enable Remote Access</a>
  • <a href="#Disabling_Remote_Access">3 Disabling Remote Access</a>
  • <a href="#SSH_Password">4 SSH Password</a>
  • <a href="#References">5 References</a>
<script type="text/javascript"> if (window.showTocToggle) { var tocShowText = "show"; var tocHideText = "hide"; showTocToggle(); } </script> <a name="Ensure_SSH_Enabled"></a>

[<a href="/wiki/index.php?title=External_SSH&action=edit&section=1" title="Edit section: Ensure SSH Enabled">edit</a>] Ensure SSH Enabled

  1. Goto the Services tab and the Services sub-tab on the <a href="/wiki/index.php/Web_Interface" title="Web Interface">Web Interface</a>
  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: [<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>].
  6. Save
<a name="Enable_Remote_Access"></a>

[<a href="/wiki/index.php?title=External_SSH&action=edit&section=2" title="Edit section: Enable Remote Access">edit</a>] Enable Remote Access

  1. Goto the Administration tab and the Management sub-tab on the <a href="/wiki/index.php/Web_Interface" title="Web Interface">Web Interface</a>
  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. 重新启动路由器

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>.

<a name="Disabling_Remote_Access"></a>

[<a href="/wiki/index.php?title=External_SSH&action=edit&section=3" title="Edit section: Disabling Remote Access">edit</a>] 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 <a href="/wiki/index.php/Web_Interface" title="Web Interface">Web Interface</a>
  2. Disable "SSH Management" under the section titled "Remote Access"
  3. Apply Settings
<a name="SSH_Password"></a>

[<a href="/wiki/index.php?title=External_SSH&action=edit&section=4" title="Edit section: SSH Password">edit</a>] 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
<a name="References"></a>

[<a href="/wiki/index.php?title=External_SSH&action=edit&section=5" title="Edit section: References">edit</a>] References

           <script type="text/javascript">
               var winheight = parseInt(document.documentElement.clientHeight)
               var boheight = parseInt(document.body.scrollHeight)
               if(winheight <= boheight) {
document.write('
<a href="#" onclick="window.scrollTo(0,0);return false;" title="Back to the top of the page"> </a>
');
               }
           </script>
  • <a href="/wiki/index.php/External_SSH">Article</a> |
  • <a href="/wiki/index.php/Talk:External_SSH">Discussion</a> |
  • <a href="/wiki/index.php?title=External_SSH&action=edit">Edit</a> |
  • <a href="/wiki/index.php?title=External_SSH&action=history">History</a> |
  • <a href="/wiki/index.php/Special:Movepage/External_SSH">Move</a> |
  • <a href="/wiki/index.php?title=External_SSH&action=watch">Watch</a>

</body></html>