Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Problem with SSH and PAM
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
MBCook
Tux's lil' helper
Tux's lil' helper


Joined: 27 Jul 2002
Posts: 136
Location: Insanity, USA

PostPosted: Thu Dec 05, 2002 12:05 am    Post subject: Problem with SSH and PAM Reply with quote

OK, I've got one for you all. I've poked around and can't seem to find an answer to this one. I have ssh on my box, simply emerged it like everyone else does. Now here is the problem: I can't get it to accept a password correctly. I know this sounds weird but here is what's happening:


  1. Try to connect (PuTTY from a windows box, or just "ssh" from a command line)
  2. Asks username/password
  3. ALWAYS rejects the password. Good passwords, bad passwords, empty passwords whatever. I've tried root (and enable it in the config file so I could), a normal user, all sorts of stuff.


I don't get this at all. In the system's logs, it complains about PAM saying the password was invalid, but I know it IS valid. I've changed the config file's options, tried the origional again, tried the sshd_config file from my other linux box (runs Debian, also openssh). No matter what I try it won't let me in. It asks me a password, but always says it wrong, even though I know it's not. From my gentoo box (the one I'm having a problem on), from my debian box, from 2 different Windows boxes. I've tried resetting the daemon many times (always after changing the config file, of course) and just about everything else I can think of. I do alot of work through SSH so this is driving me NUTS. I haven't had any other problems (users can log into the box physically, etc) so I know this isn't some kind of massive corruption problem. This box was running gentoo just fine, and I had no problems. SSH ran just fine. Then the hard drive started making funky sounds, so I replaced it and took the opportunity to reinstall the system to get rid of the stuff I didn't use. Now I've got everything on that I use, it all works fine, EXCEPT SSH.

:cry: Please help, I'm desperte. :cry:
_________________
-- Michael

Read an intelligent book like "The New Thought Police" or "The War Against Boys", and learn the TRUTH.
Back to top
View user's profile Send private message
lx
Veteran
Veteran


Joined: 28 May 2002
Posts: 1012
Location: Netherlands

PostPosted: Thu Dec 05, 2002 10:54 am    Post subject: Reply with quote

can you use ssh on the box itself? well INAE but the only thing I can think of is that keys are recreated during the new install, but this normally wouldn't be a problem not for ssh1 protocol, i suppose you have the same openssh version etc and no /etc/hosts.deny,

Hope you fix it,

Cya lX.
_________________
"Remember there's a big difference between kneeling down and bending over.", Frank Zappa
Back to top
View user's profile Send private message
gtsquirrel
Tux's lil' helper
Tux's lil' helper


Joined: 21 Nov 2002
Posts: 85
Location: San Jose, CA

PostPosted: Thu Dec 05, 2002 5:49 pm    Post subject: Same problem Reply with quote

Hey,

I'm actually having the same problem, but it's with VSFTP and SSH. I'm pretty sure that it would happen with any "server" service I would install too. From what I can tell, everything is configured properly (though it apparently isn't). PAM is set up correctly under /etc/pam.d/, my /etc/hosts.allow file contains a single line:

Code:
ALL: ALL


and my /etc/hosts.deny file is blank. I'm sure this is a DAEU issue, but does anyone out there mind helping? :-)

thanks!
Back to top
View user's profile Send private message
gtsquirrel
Tux's lil' helper
Tux's lil' helper


Joined: 21 Nov 2002
Posts: 85
Location: San Jose, CA

PostPosted: Thu Dec 05, 2002 5:57 pm    Post subject: Possible Fix Reply with quote

FYI, another bug under the forums was this same thing. Try this command:

# usermod -s /bin/bash <username>

This seems to fix the issue. Also, try running etc-update afterwards. I dunno why the hell it works, but it got mine working.
Back to top
View user's profile Send private message
lx
Veteran
Veteran


Joined: 28 May 2002
Posts: 1012
Location: Netherlands

PostPosted: Thu Dec 05, 2002 9:42 pm    Post subject: Re: Possible Fix Reply with quote

gtsquirrel wrote:
FYI, another bug under the forums was this same thing. Try this command:

# usermod -s /bin/bash <username>

This seems to fix the issue. Also, try running etc-update afterwards. I dunno why the hell it works, but it got mine working.


Strange if you need to assign /bin/bash as shell to the user, while it worked before, and therefor /bin/bash needed to be already assigned.....

Cya lX.
_________________
"Remember there's a big difference between kneeling down and bending over.", Frank Zappa
Back to top
View user's profile Send private message
MBCook
Tux's lil' helper
Tux's lil' helper


Joined: 27 Jul 2002
Posts: 136
Location: Insanity, USA

PostPosted: Thu Dec 05, 2002 9:52 pm    Post subject: Reply with quote

Yeah, that's odd. It worked fine. Anyways, I added the shell to the /etc/passwd entry (odd that it wasn't there before) and now it works. Thanks all.
_________________
-- Michael

Read an intelligent book like "The New Thought Police" or "The War Against Boys", and learn the TRUTH.
Back to top
View user's profile Send private message
rac
Bodhisattva
Bodhisattva


Joined: 30 May 2002
Posts: 6553
Location: Japanifornia

PostPosted: Fri Dec 06, 2002 2:35 am    Post subject: Re: Possible Fix Reply with quote

lx wrote:
Strange if you need to assign /bin/bash as shell to the user, while it worked before, and therefor /bin/bash needed to be already assigned.....

I'm guessing that the last half of this sentence is false. Maybe this line:
Code:
auth       required     pam_shells.so
...got added to /etc/pam.d/sshd recently.
_________________
For every higher wall, there is a taller ladder
Back to top
View user's profile Send private message
lx
Veteran
Veteran


Joined: 28 May 2002
Posts: 1012
Location: Netherlands

PostPosted: Fri Dec 06, 2002 12:21 pm    Post subject: Reply with quote

I am hereby corrected, although the last half of the sentence is correct, ;-) still the conclusion is horribly false, ;-) ; my reasoning was, if you login using ssh, it should retrieve your shell from the /etc/passwd file, and that not stating a shell would be equal to /bin/nologin or /bin/false for security reasons.
I justed tested it (to make sure) and without a shell in /etc/passwd ( +removing the shell line from pam) ssh just starts a shell (however it doesn't run the users .bash_login (cause I didn't get my custom protection scheme ;-) ).

Cya lX.
_________________
"Remember there's a big difference between kneeling down and bending over.", Frank Zappa
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum