LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   ssh login unstable (https://www.linuxquestions.org/questions/linux-newbie-8/ssh-login-unstable-499684/)

xpucto 11-08-2006 05:18 AM

ssh login unstable
 
Hi!

I tried today to loggin to my server (FC5) per ssh, and the server kept refusing my password until it finally accepted it, and again refused it by the next try!
I don´ t get it. I must precise, that I´ve never had any ssh problem with my server so far. the passwords that I give in are correct. since today it refuses my passwords most of the time, but sometime accepts them!
I have this problem with my user und with the root user. I tried the connection from 2 computers, it doesn´t change anything. Once I finally managed to logg in, I changed my user´ s password, but then I still couldn´ t login..till I suddenly managed to login again! then again not! and so on!
does anyone understand the cause of the problem? are therr maybe any log files I should looks at?!
hier is what I have in /var/log/Secure:
Quote:

Nov 8 14:11:14 myserver sshd[7259]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=myhost.myworkstation.com user=myuser
Nov 8 14:11:16 myserver sshd[7259]: Failed password for myuser from xxx.xxx.xx.xx port 43399 ssh2
Nov 8 13:11:16 myserver sshd[7260]: Failed password for myuser from xxx.xxx.xx.xx port 43399 ssh2
Nov 8 14:11:23 myserver sshd[7259]: Failed password for myuser from xxx.xxx.xx.xx port 43399 ssh2
Nov 8 13:11:23 myserver sshd[7260]: Failed password for myuser from xxx.xxx.xx.xx port 43399 ssh2
Nov 8 13:12:59 myserver sshd[7260]: Connection closed by xxx.xxx.xx.xx
I do not understand the "pam_unix(sshd:auth)" part. What does it mean?
I would really appreciate any help because the problem is very preoccupying.

xpucto 11-08-2006 02:58 PM

I tried from a third computer at home. The 1st time it worked. Then I tried again, and it didn't accept my password anymore. At the third attempt, I got:
Quote:

Permission denied (publickey,gssapi-with-mic,password)
I still don't get it!

and hier is ssh in verbose mode:
Quote:

ssh -v -l myuser myserver.com
OpenSSH_3.7.1p2, SSH protocols 1.5/2.0, OpenSSL 0.9.7b 10 Apr 2003
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to myserver.com [xxx.xxx.xx.xx] port 22.
debug1: Connection established.
debug1: identity file /home/myuser/.ssh/identity type -1
debug1: identity file /home/myuser/.ssh/id_rsa type -1
debug1: identity file /home/myuser/.ssh/id_dsa type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_4.3
debug1: match: OpenSSH_4.3 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_3.7.1p2
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-cbc hmac-md5 none
debug1: kex: client->server aes128-cbc hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host 'myserver.com' is known and matches the RSA host key.
debug1: Found key in /home/myuser/.ssh/known_hosts:12
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,gssapi-with-mic,password
debug1: Next authentication method: publickey
debug1: Trying private key: /home/myuser/.ssh/identity
debug1: Trying private key: /home/myuser/.ssh/id_rsa
debug1: Trying private key: /home/myuser/.ssh/id_dsa
debug1: Next authentication method: password
myuser@myserver.com's password:
debug1: Authentications that can continue: publickey,gssapi-with-mic,password
Permission denied, please try again.
myuser@myserver.com's password:
debug1: Authentications that can continue: publickey,gssapi-with-mic,password
Permission denied, please try again.
myuser@myserver.com's password:
debug1: Authentications that can continue: publickey,gssapi-with-mic,password
debug1: No more authentication methods to try.
Permission denied (publickey,gssapi-with-mic,password).
debug1: Calling cleanup 0x80645d0(0x0)

chrism01 11-08-2006 07:10 PM

That's pretty strange. ssh either works or it doesn't, so I'd suspect a non-ssh issue.
Next time you get on, pref from local keyboard, run top and see if the system is under extreme load.
The other possibility is that it's been rooted/hacked, or it's being attempted to be hacked and if you check /var/log/messages or root email, you'll find thousands of root ssh login attempts from botnets. Very common these days.
It's highly recommended that you disable root ssh access and instead grant your non-root acct full access via 'sudo su -'.
Ideally, also restrict range of IPs ssh will respond to.
Of course, it may be none of the above...

xpucto 11-09-2006 01:33 AM

Quote:

Originally Posted by chrism01
That's pretty strange. ssh either works or it doesn't, so I'd suspect a non-ssh issue.
Next time you get on, pref from local keyboard, run top and see if the system is under extreme load.
The other possibility is that it's been rooted/hacked, or it's being attempted to be hacked and if you check /var/log/messages or root email, you'll find thousands of root ssh login attempts from botnets. Very common these days.
It's highly recommended that you disable root ssh access and instead grant your non-root acct full access via 'sudo su -'.
Ideally, also restrict range of IPs ssh will respond to.
Of course, it may be none of the above...

thank you for your answer. You seem to be pretty right. I tried to loggin from the keyboard. It doens't work either. last night I could once loggin and I created a new user (unfortunatly it doesn't have any root rights). since then it is the only user that doens't have any problem to loggin.
in /var/lg/messages there are indeed thousand attempts to loggin as a root. But I've always seen such attempts, is one supposed to react when seeing such attempts? because there are actually continually happening. Am I suppposed to exclude the IP address (within the firewall) each time?!

As soon as I managed to loggin again I'll do what you adviced me.
But I can I get things back so that I do not have any loggins problems anymore?
How may I prevent this in the future? I actually have configured a firewall.


All times are GMT -5. The time now is 04:03 PM.