我和我的女朋友共享一个我为不同的东西设置的 Ubuntu 服务器。然而,最近,她遇到了一个问题,让我、她和我们各自的同事都感到困惑和困惑。
每当她使用工作的 WiFi 工作时,她都会使用 PuTTy 进行连接,但只会收到“服务器意外关闭网络连接”错误。在出现错误之前,她从未被提示输入密码。如果她将手机设置为连接笔记本电脑的热点,她就可以成功登录。如果她在家或在我家,她也可以使用同一台笔记本电脑登录(没有热点)。当手机连接到她工作的 WiFi 时,她还可以使用手机登录。
在auth.log服务器上,我看到她的连接尝试进入,但唯一的帖子是一个说明
refused connect from [IP-ADDRESS] ([IP-ADDRESS])
Run Code Online (Sandbox Code Playgroud)
该日志中没有更多信息。
到目前为止我们尝试过的东西(包括“我严重怀疑这会奏效,但为什么不行”-尝试):
在 Chrome 中添加 SecureShell 插件来替换 Putty(结果相同,但错误略有不同:
ssh_exchange_identification: Connection closed by remote host NaCl plugin exited with status code 255
Run Code Online (Sandbox Code Playgroud)对这里可能发生的事情还有其他想法吗?
编辑:
/etc/ssh/sshd_config 的内容,以及请求 iptables -L 时的输出:
# Package generated configuration file
# See the sshd_config(5) manpage for details
# What ports, IPs and protocols we listen for
Port 22
# Use these options to restrict which interfaces/protocols sshd will bind to
#ListenAddress ::
#ListenAddress 0.0.0.0
Protocol 2
# HostKeys for protocol version 2
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key
HostKey /etc/ssh/ssh_host_ed25519_key
#Privilege Separation is turned on for security
UsePrivilegeSeparation yes
# Lifetime and size of ephemeral version 1 server key
KeyRegenerationInterval 3600
ServerKeyBits 1024
# Logging
SyslogFacility AUTH
LogLevel INFO
# Authentication:
LoginGraceTime 120
PermitRootLogin yes
StrictModes yes
RSAAuthentication yes
PubkeyAuthentication yes
#AuthorizedKeysFile %h/.ssh/authorized_keys
# Don't read the user's ~/.rhosts and ~/.shosts files
IgnoreRhosts yes
# For this to work you will also need host keys in /etc/ssh_known_hosts
RhostsRSAAuthentication no
# similar for protocol version 2
HostbasedAuthentication no
# Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication
#IgnoreUserKnownHosts yes
# To enable empty passwords, change to yes (NOT RECOMMENDED)
PermitEmptyPasswords no
# Change to yes to enable challenge-response passwords (beware issues with
# some PAM modules and threads)
ChallengeResponseAuthentication no
# Change to no to disable tunnelled clear text passwords
#PasswordAuthentication yes
# Kerberos options
#KerberosAuthentication no
#KerberosGetAFSToken no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes
# GSSAPI options
#GSSAPIAuthentication no
#GSSAPICleanupCredentials yes
X11Forwarding yes
X11DisplayOffset 10
PrintMotd no
PrintLastLog yes
TCPKeepAlive yes
#UseLogin no
#MaxStartups 10:30:60
#Banner /etc/issue.net
# Allow client to pass locale environment variables
AcceptEnv LANG LC_*
Subsystem sftp /usr/lib/openssh/sftp-server
# Set this to 'yes' to enable PAM authentication, account processing,
# and session processing. If this is enabled, PAM authentication will
# be allowed through the ChallengeResponseAuthentication and
# PasswordAuthentication. Depending on your PAM configuration,
# PAM authentication via ChallengeResponseAuthentication may bypass
# the setting of "PermitRootLogin without-password".
# If you just want the PAM account and session checks to run without
# PAM authentication, then enable this but set PasswordAuthentication
# and ChallengeResponseAuthentication to 'no'.
UsePAM yes
Run Code Online (Sandbox Code Playgroud)
还; iptables -L 的输出:
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
Run Code Online (Sandbox Code Playgroud)
编辑2:
我当然不能确定,但我认为她的工作很可能不会因为以下几个原因阻止端口 22 上的出站流量:
小智 22
refused connect from [IP-ADDRESS] ([IP-ADDRESS])
Run Code Online (Sandbox Code Playgroud)
当TCP 包装器库决定拒绝连接时,它会发出此特定消息。Ubuntusshd是为使用 TCP 包装器而构建的。
检查 ssh 服务器上的“/etc/hosts.allow”和“/etc/hosts.deny”两个文件。您在这些文件之一中有一个条目,导致来自该地址的 ssh 连接被拒绝。有关这些文件,请参阅 Ubuntu 手册页。
| 归档时间: |
|
| 查看次数: |
26350 次 |
| 最近记录: |