2

I have a computer at home running on 14.04. I would like to be able to send jobs to that computer (I will call it server) from my laptop (running on 15.04) and share files between the two. I am able to ssh into the server when my laptop is connected to the same router as the server. However when I try to ssh from a different network I cannot get in. I have tried many solutions offered by people in this forum to no avail.

Here is a list of things I have tried so far:

Making sure that there is no firewall:

sudo iptables -L

shows that there are no firewalls running.

sudo lsof -i | grep ssh

shows that the server is listening to port 22. I have gone into my router settings and set port 22 to forward to the server. Using canyouseeme.org I have verified that port 22 is visible on the server.

I have tried using different ports than 22 by changing the settings in /etc/ssh/sshd_config (on the server) to a different port and running the command

ssh -p 77 user@server

from my laptop. I have tried registering the server with noip.com and the command

ssh [email protected]

but I get the error message

port 22: Connection timed out.

When I try the command

ssh user@serverpublicIPv6ip

I get an error message of

port 22: Connection refused

and when I try

ssh user@serverpublicMACip

I get the same "connection timed out" message as I get with the ddns attempts. openssh-client and openssh-server are installed on both pcs and I have verified that when I try to run the ssh commands the ssh daemons are running on both pcs. When I try to ssh using the ddns.net address I have verified that the noip2 process is running in the background. I have also modified the /etc/ssh/sshd_config to include the line

GatewayPorts yes

I know this question has been asked before but so far none of the solutions on other posts have helped me, and I have read through all of them that I can find. I'm fairly experienced with ubuntu but very new to networking with it. Thank you in advance for your replies!

Edit: The sshd_config file is as follows:

# 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 without-password
StrictModes no

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

GatewayPorts 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

@JackWasey I'm not sure exactly how to answer that question. I have an Arris "router" attached to a coaxial cable that feeds Wi-Fi or ethernet to the server. I use quotation marks around router because I believe it is a combined modem/router. I have gone onto my ISP's website and modified the router settings to forward port 22, in addition to a few other ports to attempt to use them for ssh. Ideally I would like to be able to use the domain I set up through noip.com, as it seems my IP address on the server changes fairly regularly.

3
  • 1
    You have a router between Internet and server? How is that configured? Outbound firewall from wherever laptop is?
    – Jack Wasey
    Oct 22, 2015 at 1:12
  • can you post your /etc/ssh/sshd_config file? connection refused is a good sign, it means you made contact, and were denied.
    – j0h
    Oct 22, 2015 at 1:14
  • 7
    You did set up port forwarding on the router, right? Oct 22, 2015 at 1:17

0

You must log in to answer this question.

Browse other questions tagged .