在Ubuntu上使用SSH问题 – 本地连接正常,远程连接 – 是我还是我的ISP?

我有一个运行Ubuntu 12.04的服务器的问题,我正在尝试建立一个远程连接,以便我可以从外面访问我工作的服务器.我已经安装了SSH服务器和所有这些东西,我已经重新分配了22到3399的认端口.

任何操作系统的本地连接都可以连接到192.168 …地址,但我无法获得实际IP地址的连接.

我相信我的配置是正确的,我会附上它.如果我在配置中做错了,请告诉我,我会对其进行更改.

老实说,我认为我的ISP提供的路由器非常糟糕,虽然转发了ssh的端口,但它可能会阻止任何流入的流量.有什么我可以尝试验证这个吗?当我连接VIA静态IP时,/ var / log / auth不显示任何错误.我已经包含了以下未注释的所有值:(sshd_config)

Port 3399

ListenAddress 0.0.0.0
Protocol 2

HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key
UsePrivilegeSeparation yes
KeyRegenerationInterval 3600
ServerKeyBits 768
SyslogFacility AUTH
LogLevel INFO
LoginGraceTime 120
PermitRootLogin yes
StrictModes yes
UsednS no
RSAAuthentication yes
IgnoreRhosts yes
RhostsRSAAuthentication no
HostbasedAuthentication no
PermitEmptyPasswords no
ChallengeResponseAuthentication no
PasswordAuthentication yes
GSSAPIAuthentication no
X11Forwarding yes
X11displayOffset 10
PrintMotd no
PrintLastLog yes
TCPKeepAlive yes
AcceptEnv LANG LC_*
Subsystem sftp /usr/lib/openssh/sftp-server
UsePAM yes

我做错了吗?

port forwarding image

编辑:有没有办法检查连接是否到达服务器?我运行ssh -vvv到我的IP,它说它加载我的本地ssh配置,我需要配置吗?低于v

OpenSSH_5.9p1 Debian-5ubuntu1,OpenSSL 1.0.1 14 Mar 2012
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to 204.191.22.127 [204.191.22.127] port 3399.
debug1: connect to address 204.191.22.127 port 3399: Connection refused

Here’s the result of a ssh -vvv to my local 192.168 server

在路由器上,确保将外部IP上的端口3399转发到内部IP上的端口3399.如果它不允许您指定端口号,那么您必须将sshd配置更改为在端口22上运行并设置路由器以转发到该端口号.

你的sshd配置看起来很好.我的建议是你创建一个具有完全sudo访问权限的常规用户帐户,然后在sshd配置中将PermitRootLogin更改为no并重新启动sshd服务.然后使用常规用户帐户ssh进入服务器并使用sudo进行管理.

相关文章

目录前言一、创建Hadoop用户二、更新apt和安装Vim编辑器三、...
原文连接:https://www.cnblogs.com/yasmi/p/5192694.html ...
电脑重启后,打开VirtualBox,发现一直用的虚拟机莫名的消失...
参见:https://blog.csdn.net/weixin_38883338/article/deta...
Ubuntu 18.04 LTS 已切换到 Netplan 来配置网络接口。Netpla...
介绍每个 Web 服务都可以通过特定的 URL 在 Internet 上访问...