Linux – ssh can’t connect using hostname

bindhostnamelinuxsshubuntu-10.04

I'm setting up some server but I stubbled into an issue with one server.

I setup a local dns server, and when I try to connect to this server with ssh alpha@alpha.stvns.com I will get : Permission denied (publickey,keyboard-interactive).

But when I access it like alpha@192.168.1.2 it works fine with Pubkey Auth.
Strange part is when I connect to a server git.stvns.com => a hostname managed by the dns server, it will connect fine when using the hostname.

I'm using a ubuntu 10.04 amd64 as base for all the server, they are actually identical images I took a snapshot from the bare minimum setup, so can't blame the OS.

I compared my sshd_config files but they are almost Identical, only the place of the authorized_keys is different, can't blame that full for giving problems.

Locally I removed my known_hosts related to the dns server and tried again without any luck.

This is a copy of my sshd_config file maybe someone spots a error:

Port                             22
Protocol                         2
HostKey                         /etc/ssh/ssh_host_rsa_key
HostKey                         /etc/ssh/ssh_host_dsa_key
UsePrivilegeSeparation          yes
LoginGraceTime                  20
PermitRootLogin                 no
RSAAuthentication               yes
RhostsRSAAuthentication         yes
HostBasedAuthentication         no
PubkeyAuthentication            yes
AuthorizedKeysFile              /etc/ssh/authorized_keys
PermitEmptyPasswords            no
PasswordAuthentication          no
StrictModes                     no
ClientAliveInterval             60
ClientAliveCountMax             0

# Host Specific !!!!!
ListenAddress                   192.168.1.61

# List of allowed users
AllowUsers                      alpha

# Lifetime and size of ephemeral version 1 server key
KeyRegenerationInterval 3600
ServerKeyBits 768

# Logging
SyslogFacility AUTH
LogLevel INFO

X11Forwarding yes
X11DisplayOffset 10
PrintMotd no
PrintLastLog yes
TCPKeepAlive yes
#UseLogin no

# Allow client to pass locale environment variables
AcceptEnv LANG LC_*

Does anyone countered the same problem?
Or has some advise?

Thanks a lot in advance!

Best Answer

run

ping git.stvns.com

Are you see 192.168.1.2 ip?

I think you havenot problem with ssh, you have problem with dns.

What dns server are you use? (cat /etc/resolv.conf )