I have an issue with a server running Ubuntu 12.04, I am trying to set up a remote connection so I can access the server at my work from out of town. I have installed the SSH server and all that stuff, and I have reassigned the default port from 22 to 3399.

A local connection from any OS can connect on the 192.168... address, but in no way can I get a connection on the actual IP address.

I believe my configuration is correct, and I will attach it. If I have done something wrong in the config, please tell me and I will make a change to it.

I honestly think that the Router that my ISP provided is horrible, and although the port for ssh is forwarded, it might be stopping any traffic coming inbound. Is there anything I can try to verify this? /var/log/auth does not show any error when I connect VIA our static IP. I have included all values not commented out below: (sshd_config)

Port 3399

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

Am I doing this wrong?

port forwarding image

EDIT: Is there a way to check if a connection even reaches the server? I ran ssh -vvv to my IP and it says it loads my local ssh config, do I need to configure this? below 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 [] port 3399.
debug1: connect to address port 3399: Connection refused

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

  • I will be going home and picking up my personal Router on my lunch break to hook into this system and see if it changes anything by bybassing the ISP hardware. I am still game for trying any suggestions anyone might have. I leave this company tomorrow but I need to be able to remotely access the server to troubleshoot anything. This is priority #1!! :) – Benjamin Aug 30 '12 at 15:59
  • So I believe my issue is, I am trying to remotely access my local network from inside my local connection. I will try to find another computer to attempt to connect with and report progress. Going to be mad at myself if the solution is this simple... – Benjamin Aug 30 '12 at 16:48
  • To watch for connections coming in on port 3399, do the following on your server as root (or sudo): "tcpdump port 3399". I recommend running that at the console of the server. – Sean Staats Aug 30 '12 at 17:05
  • Your port forwarding config looks correct. I assume you're using a real IP address instead of the ".xxx" part for the remote IP address. You might try temporarily using the address for the remote IP configuration to help with troubleshooting. Then when you can connect with that, change to the correct IP. – Sean Staats Aug 30 '12 at 17:12
  • You are correct, everything was set correctly. The problem was trying to remotely access a local server. :( Thanks for lending me a hand Saxon! – Benjamin Aug 30 '12 at 17:25

On your router, ensure that you are forwarding port 3399 on your external IP to port 3399 on your internal IP. If it doesn't allow you to specify port numbers, then you'll have to change your sshd config back to run on port 22 and setup your router to forward to that.

Your sshd config looks fine. My recommendation on that is for you to create a regular user account that has full sudo access, then change PermitRootLogin to no in your sshd config and restart the sshd service. Then ssh into the server with your regular user account and use sudo for administrative purposes.

  • I know the ports are forwarded, but I will double check the configuration. I have a sudoer user set up so I could do the RootLogin thing too. Would that cause a connection issue, or is it a suggestion? – Benjamin Aug 30 '12 at 15:19
  • I attached a picture of my port forwarding interface – Benjamin Aug 30 '12 at 15:28
  • Changing the RootLogin setting won't cause or fix a connection issue. – Sean Staats Aug 30 '12 at 17:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.