Heads up I'm a noob with linux and networking.

I set up a ubuntu server and I have a static ip for my network. When I try to connect to the server at home (external), it prompts me to log in. I supply the correct password (or incorrect pw), I get the error Permission denied, please try again.

and after 3 times I get

Permission denied (publickey,gssapi-with-mic,password)

I am however able to connect with SSH from another computer in the same network with ssh < internal ip of server >

I'm connecting with mac os x and my config file is vanilla.

Note: During installation of ubuntu it says I don't have a default route or something while doing auto network configuration, but I ignored it and continued the installation, could this be the problem?


I have tried the below, I have nothing in hosts.allow and also iptables shows the ports that I have allowed, which is 22.

I checked the auth.log, and there is nothing when I connect to it remotely (even when it says permission denied). I have tried connecting to it internally and the correct authentication logs show. Any idea whats wrong?

  • What is the output of iptables -L -v -n?
    – quanta
    Commented Sep 4, 2011 at 5:42
  • I believe I have found the problem. The network admin forwarded the ports to the wrong destination, when the server is at Still kind of weird because it seemed like I was able to connect to the ubuntu server with the correct username at login. Thanks anyway!
    – zentenk
    Commented Sep 4, 2011 at 6:11
  • That's why you're supposed to check the fingerprint when it says "The authenticity of host ________ can't be established." - so that you're not just sending your password to a random machine.
    – nickgrim
    Commented Aug 5, 2012 at 11:43

1 Answer 1


It sounds like your ssh server is only allow login from specific IP. Check /etc/hosts.allow if you see something like this:

sshd: IP

Also check if you have iptables is running:

iptables -L -v -n

Take a look at /var/log/auth.log, it will tell you more details.

  • thanks I'll check it tomorrow, but what do I do if it /etc/hosts.allow shows sshd: IP?
    – zentenk
    Commented Sep 3, 2011 at 10:25
  • Remove that line if you want to allow login from any IP.
    – quanta
    Commented Sep 3, 2011 at 10:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .