我的朋友和我正在尝试通过外部网络在他的服务器上获取ssh访问权限。他正在运行Debian 7.1。他可以从内部网络访问服务器,但每次我尝试访问他的服务器(当然是从外部网络),我都会收到以下错误。
debug1: Authentications that can continue: publickey,password
debug3: start over, passed a different list publickey,password
debug3: preferred publickey,keyboard-interactive,password
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /Users/MyUser/.ssh/id_rsa
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue: publickey,password
debug1: Trying private key: /Users/MyUser/.ssh/id_dsa
debug3: no such identity: /Users/MyUser/.ssh/id_dsa
debug2: we did not send a packet, disable method
debug3: authmethod_lookup password
debug3: remaining preferred: ,password
debug3: authmethod_is_enabled password
debug1: Next authentication method: password
MyUser@HisServer.com's password:
debug3: packet_send2: adding 64 (len 56 padlen 8 extra_pad 64)
debug2: we sent a password packet, wait for reply
debug1: Authentications that can continue: publickey,password
Permission denied, please try again.
~/.ssh/
的权限为700,~/.ssh/*
为600.他有
RSAAuthentication yes
PubkeyAuthentication yes
ChallengeResponseAuthentication yes
PasswordAuthentication no
UsePAM yes
包含在他的sshd_config
中。
端口检查器说Port 22 / tcp是开放的。最奇怪的是,我们在日志中找不到任何访问历史记录。 sudo grep ssh /var/log/*
只显示他的活动。
因此,我怀疑这是导致问题的路由器配置,但是如果端口打开我们不应该ssh吗?
答案 0 :(得分:1)
您需要将路由器或DSL调制解调器配置为将端口22端口转发到端口22上服务器的IP地址。 检查是否存在连接问题的简单测试是在端口22上telnet:
telnet xxx.xxx.xxx.xxx 22
其中x代表路由器的外部IP地址。
答案 1 :(得分:0)
也许这会有所帮助。 尝试使用外部ip adres在http://www.whatismyip.com/找到你的ex.ip地址。 我已经坐了差不多4个星期才发现不使用我的192.168.x.xxx地址 但要使用外部的88.67.xx.xxx。 对不起我的电视英语。
答案 2 :(得分:0)
我们无法从外部网络ssh的原因是因为我的朋友有一个“嵌套局域网”。
事实证明他的公寓有自己的局域网,所以即使他将tcp / 22端口转发到他服务器的私有IP地址(在他家的局域网内),外部访问也会卡在公寓的局域网中。
如果我没记错的话,他本可以为每个端口支付大约30美元来打开数字大于1000的端口,但他认为这不值得,所以我们基本放弃了。
答案 3 :(得分:0)
您可以使用Corkscrew通过HTTP隧道传输ssh流量。没有必要支付那么荒谬的30美元。