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

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

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

我相信我的configuration是正确的,我会附上。 如果我在configuration中做了错误的事情,请告诉我,我会改变它。

我真的认为,我的ISP提供的路由器是可怕的,尽pipessh的端口被转发,它可能会阻止任何stream量入站。 有什么我可以尝试validation这一点? 当我连接威盛静态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 

我做错了吗?

端口转发图像

编辑:有没有办法来检查连接是否到达服务器? 我运行ssh -vvv到我的IP,它说它加载我本地的SSHconfiguration,我需要configuration这个? 低于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 

这是一个ssh -vvv到我的本地192.168服务器的结果

在您的路由器上,确保您将外部IP上的端口3399转发到内部IP上的端口3399。 如果它不允许你指定端口号,那么你将不得不把你的sshdconfiguration改回到在端口22上运行,并设置你的路由器来转发。

你的sshdconfiguration看起来不错。 我build议你创build一个具有完整sudo访问权限的普通用户帐户,然后在sshd config中将PermitRootLogin更改为no并重新启动sshd服务。 然后使用普通用户帐户login服务器,并使用sudo进行pipe理。