3

I'm trying to connect SSH using Putty to my server but somehow I cannot connect and it comes with Access Denied error when I type in my username.

Is there something I need to do to fix this issue?

user952543
  • 155
  • 1
  • 1
  • 4
  • you can add more details ? – JuanPablo Oct 02 '11 at 23:16
  • 1
    In putty, in host field try : username@ip_server – JuanPablo Oct 02 '11 at 23:18
  • Does your server have SSH installed? you have the right port (22)? – Book Of Zeus Oct 02 '11 at 23:19
  • Is the port open on the server? Can your client send data to the server's port? (Try `telnet servername 22` or `netcat servername 22` and look for `SSH-2.0-...` banner message.) Try the 'real' `ssh` client program, run it with the `ssh -v servername` `-v` command line option to dump debugging messages, you might find why putty can't connect that way. – sarnold Oct 02 '11 at 23:26
  • @user952543, can you look at my answer and see if that works for you? It sounds like a putty problem and not a server problem. – Rilindo Oct 03 '11 at 01:44
  • 1
    Rilindo you are absolutely right!!! – user952543 Oct 03 '11 at 02:01

2 Answers2

1

Chances are this problem isn't PuTTY specific and you'll encounter it with any SSH client. You either don't have permission to log in via SSH or you have the wrong username/password combo.

You should ensure that your user account is listed in the AllowUsers field in sshd.conf. Additionally if you are trying to log in directly as root you should make sure that PermitRootLogin is set to yes. You should note that allowing root login is bad. Very bad.

MDMarra
  • 100,734
  • 32
  • 197
  • 329
  • I'm using port 22. I'm sure I'm using correct username/password it's just coming up with Access Denied immediately after when you type in username and hit enter. Can this be a firewall issue? – user952543 Oct 02 '11 at 23:44
  • Did you verify the settings that I mentioned? This sounds a lot like you're not listed in the AllowedUsers directive that I mentioned. It would probably be helpful for you to post your entire sshd.conf – MDMarra Oct 02 '11 at 23:57
  • If it were firewall-related you wouldn't get the chance to enter your account info. – Keith Stokes Oct 03 '11 at 00:46
  • I imported the private key but it's coming up with unable to use key file error. Where do you find sshd.conf? I'm using Windows and server is UNIX – user952543 Oct 03 '11 at 00:48
  • It's on the server-side. If you don't control the server, you shouldn't be posting here. – MDMarra Oct 03 '11 at 01:02
  • Guys look above answer it's nothing to do with server-side – user952543 Oct 04 '11 at 02:15
1

Putty has GSSAPI enabled by default.

Putty GSSAPI Configuration

Turn it off if you are not using Kerberos (and chances are, you are not in your environment).

Explanation:

I dealt with a few weeks back with when a new administrator could not login to any ssh host with putty - even the one that I know should be working for him. It seems that with GSSAPI Auth enabled, Putty will attempt to login with non-existent kerberos credentials, which resulted in an immediate Access Denied message:

enter image description here

By way of comparison, here is me trying to login to a host that has the DenyUsers directive enabled (and without GSSAPI Auth enabled):

enter image description here

Rilindo
  • 5,078
  • 5
  • 28
  • 46
  • Its worth noting, though, that after additional testing that even though you may get Access Denied immediately, you can still get logged in as it appears to fall back to password credentials. So either a)The OP was being thrown off by the message and guinuely though that he couldn't login or b) his putty client is not falling back to user/pass auth. – Rilindo Oct 03 '11 at 02:28