1570a [Solved] Ssh Login Rejected : authentication error for illegal user - The FreeBSD Forums
The FreeBSD Forums  

Go Back   The FreeBSD Forums > Base System > General

General General questions about the FreeBSD operating system. Ask here if your question does not fit elsewhere.

Reply
 
Thread Tools Display Modes
  #1  
Old February 6th, 2009, 18:02
mrfontana mrfontana is offline
Junior Member
 
Join Date: Feb 2009
Posts: 5
Thanks: 1
Thanked 0 Times in 0 Posts
Default Ssh Login Rejected : authentication error for illegal user

Hello all, I am having a problem with the lastest production release(7.1). When logging in through ssh, I am able to do it for the first few times, but then after that, my login keeps getting rejected with this error.

Code:
sshd[852]:error:pam:authentication error for illegal user
I have added AllowUsers with the correct user to the sshd_config files and restarted the server several times, yet my login is still being rejected. Any ideas as to what could be causing this?
Reply With Quote
  #2  
Old February 6th, 2009, 20:39
graudeejs's Avatar
graudeejs graudeejs is offline
Style(9) Addict
 
Join Date: Nov 2008
Location: Riga, Latvia
Posts: 4,530
Thanks: 424
Thanked 612 Times in 479 Posts
Default

Have you changed default password encryption algorithm (/etc/auth.conf and /etc/login.conf) recently? (i had some problems with pam in past, i think it was due to my hardening, but i'm not sure)


----
I use public key authentication... works great btw.
http://forums.freebsd.org/showthread.php?t=1508
Reply With Quote
  #3  
Old February 6th, 2009, 21:01
mrfontana mrfontana is offline
Junior Member
 
Join Date: Feb 2009
Posts: 5
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Nope, everything is default from a fresh install. It worked once or twice, then it just stopped
Reply With Quote
  #4  
Old February 6th, 2009, 22:35
anomie's Avatar
anomie anomie is offline
Member
 
Join Date: Nov 2008
Location: Texas
Posts: 783
Thanks: 49
Thanked 113 Times in 100 Posts
Default

Quote:
Originally Posted by mrfontana
When logging in through ssh, I am able to do it for the first few times, but then after that, my login keeps getting rejected with this error.
Do you mean it worked following initial installation but then stopped working, and has not worked since? Or do you mean it works sporadically, but only for a few tries, and then it stops working for awhile?

Quote:
Originally Posted by mrfontana
Code:
sshd[852]:error:pam:authentication error for illegal user
Is that the entire message from auth.log? What user are you trying to log in as? What sort of client software are you using?
Reply With Quote
  #5  
Old February 6th, 2009, 23:07
mrfontana mrfontana is offline
Junior Member
 
Join Date: Feb 2009
Posts: 5
Thanks: 1
Thanked 0 Times in 0 Posts
Default

I logged in like 3 times since the install, then it started and still does deny my login with the response to my client "Access Denied". I am using Putty as my client. The exact message I am getting from the auth.log is:

Code:
Invalid user bob from 192.168.1.50
error:PAM:authentication for illegal-user bob from windows-machine-name
Failed keyboard-interactive/pam for invalid user from 192.168.1.50 port 2982 ssh2
bob is the user I am trying to login with. It's a member of wheel if that helps.
Reply With Quote
  #6  
Old February 6th, 2009, 23:34
anomie's Avatar
anomie anomie is offline
Member
 
Join Date: Nov 2008
Location: Texas
Posts: 783
Thanks: 49
Thanked 113 Times in 100 Posts
Default

I'd be curious to see the output from a couple commands:

# egrep -i 'allow|deny' /etc/ssh/sshd_config

# grep 'bob' /etc/passwd

(I am also assuming you've reloaded or restarted sshd following and config file changes.)
Reply With Quote
  #7  
Old February 6th, 2009, 23:53
johnblue johnblue is offline
Member
 
Join Date: Jan 2009
Location: O-o-o-o-o-o-o-klahoma
Posts: 176
Thanks: 11
Thanked 17 Times in 15 Posts
Default

Quote:
Originally Posted by anomie View Post
I'd be curious to see the output from a couple commands:
Agreed. An invalid user is an invalid user. Here are some SSH hammer attempts from my auth.log:
Code:
Feb  5 21:41:27 Invalid user james from 208.96.162.136
Feb  5 21:41:28 Invalid user austin from 208.96.162.136
Feb  5 21:41:29 Invalid user jackson from 208.96.162.136
Feb  5 21:41:30 Invalid user justin from 208.96.162.136
Feb  5 21:41:31 Invalid user brandon from 208.96.162.136
Feb  5 21:41:32 Invalid user john from 208.96.162.136

Last edited by DutchDaemon; February 12th, 2012 at 14:59.
Reply With Quote
  #8  
Old February 7th, 2009, 00:46
mrfontana mrfontana is offline
Junior Member
 
Join Date: Feb 2009
Posts: 5
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Absolutely right. I ran the command and found out the user was bob1 and I had added bob to the AllowUsers. Thanks for the help and sorry for wasting everyone's time with my noob mistake.
Reply With Quote
  #9  
Old February 7th, 2009, 00:58
graudeejs's Avatar
graudeejs graudeejs is offline
Style(9) Addict
 
Join Date: Nov 2008
Location: Riga, Latvia
Posts: 4,530
Thanks: 424
Thanked 612 Times in 479 Posts
Default

small things make big difference
Reply With Quote
  #10  
Old February 7th, 2009, 03:40
johnblue johnblue is offline
Member
 
Join Date: Jan 2009
Location: O-o-o-o-o-o-o-klahoma
Posts: 176
Thanks: 11
Thanked 17 Times in 15 Posts
Default

Quote:
Originally Posted by mrfontana View Post
Thanks for the help and sorry for wasting everyone's time with my noob mistake.
I think most normal people associated with BSD are here to help and so no apologies are needed, but ya need to give props to anomie for helping ya with those grep statements.

Reply With Quote
  #11  
Old February 7th, 2009, 15:37
mrfontana mrfontana is offline
Junior Member
 
Join Date: Feb 2009
Posts: 5
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Yeah, big thanks to Anomie, those statements wrapped it up pretty quick. Great work. I am going to still checkout that guide for using keys, thanks to killasmurf86 as well.
Reply With Quote
  #12  
Old February 12th, 2012, 11:57
malsaie malsaie is offline
Junior Member
 
Join Date: Feb 2012
Location: Bahrain; Qatar
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

[ Warning: bad and unsafe advice follows. -- Mod. ]

To enable SSH on FreeBSD

# vi /etc/ssh/sshd_config

Code:
PermitRootLogin no----> yes
:wq

# /etc/rc.d/sshd restart

Last edited by DutchDaemon; February 12th, 2012 at 14:59. Reason: Proper formatting: http://forums.freebsd.org/showthread.php?t=8816
Reply With Quote
  #13  
Old February 12th, 2012, 12:22
kpa kpa is online now
Giant Locked
 
Join Date: Jul 2010
Location: People's Technocratic Republic of Finland
Posts: 2,139
Thanks: 46
Thanked 510 Times in 433 Posts
Default

1) You're replying to a 3 year old thread

2) Your advice is dangerous unless your network is properly isolated from the hostile internet, do not enable ssh root login unless there's a good reason to.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Solved] SSH + LDAP + Public key authentication - can it be done? dvdmandt Web & Network Services 5 February 17th, 2011 09:09
How do get SSH login to work with authentication through OpenLDAP? olav Web & Network Services 2 December 15th, 2010 23:37
[Solved] SSH situation and authentication. dragos240 Installing & Upgrading 4 September 23rd, 2010 03:10
[Solved] [XFCE] can“t login as root. Only as (standar) user can login. rokpa92 Other Window Managers 17 September 11th, 2009 13:13
Authentication with SSH keys dennylin93 Web & Network Services 3 July 30th, 2009 13:56


All times are GMT +1. The time now is 00:07.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
The mark FreeBSD is a registered trademark of The FreeBSD Foundation and is used by The FreeBSD Project with the permission of The FreeBSD Foundation.
Web protection and acceleration provided by CloudFlare
0