# Login via Telnet but not ssh?



## fantasygoat (Apr 20, 2010)

I'm setting up a new FreeBSD 8.0 box and I am having some really curious problems with adding users.

There is an existing user that I can log in with via telnet, but I cannot log in via ssh.  I also tried adding a user and that user can't log in from either!

I've looked for the allowed username in various /etc files to no avail.  I created the user with adduser and when I try to login I get the following in the messages log:


```
sshd[20182]: error: PAM: authentication error for illegal user username from x.x.x.x
```

There's also no "AllowedUsers" entry in sshd_config.  Any clues as to where I might start debugging this issue?


----------



## bschmidt (Apr 20, 2010)

Maybe the user's shell or home directory has some kind of influence?


----------



## fantasygoat (Apr 20, 2010)

Same shell, permissions on home directory identical.  Also, the one user can login via telnet, just not via ssh.


----------



## bschmidt (Apr 20, 2010)

Something weird in $HOME/.ssh/?


----------



## gilinko (Apr 20, 2010)

How did you add the user? Did you edit /etc/passwd directly?


----------



## SirDice (Apr 20, 2010)

Few things to check I guess. Is /etc/pam.d/sshd changed? 
Perhaps /etc/hosts.allow and/or /etc/hosts.deny?


----------



## anomie (Apr 21, 2010)

fantasygoat said:
			
		

> I created the user with adduser and when I try to login I get the following in the messages log:
> 
> 
> ```
> ...



Check for all the sshd_config(5) possibilities that commonly generate that exact message: AllowUsers, DenyUsers, AllowGroups, DenyGroups. 

Also check /etc/login.access for any uncommented directives. 

Hopefully you haven't been tweaking your PAM configuration. (If you have, review that next.)


----------

