如何使用SSH连接到localhost(PuTTy)

use*_*723 11 putty

我刚想到如何使用PuTTy连接到我的webhost.

但是如何连接到我的localhost?我放

Servername:localhost端口:22(我也试过80)

它给我一个错误"无法连接"

我该如何连接?

Jan*_*Jan 6

如果您在本地主机上使用Cygwin,则可以连接到Cygwin sshd(SSH守护程序).

3个简单的命令来安装sshd作为服务:(当你启动机器时总是在那里)

$ ssh-host-config -y # enable sshd. "-y" answers yes to all queries.
$ cygrunsrv --start sshd # start it as an autostart Windows service
$ ssh localhost # try to recursively log in via ssh
Run Code Online (Sandbox Code Playgroud)

摘自:http://nfnaaron.posterous.com/tag/puttycyg#Section2 (第二种方法)

=>您获得整个ssh基础结构:公钥认证,ssh-agent等...


Flo*_*ian 3

确保您已在 localhost 上运行 SSH 服务器(例如 openssh-server),而不仅仅是 Web 服务器(例如 apache)。还要确保 localhost 确实映射到 127.0.0.0/8