I've done several attempts to establish SSH-connecton for user root@host using putty terminal. While doing so I specified wrong credentials several times and after that I've specified them correctly, and then after the credentials were accepted the ssh session breaks with
This error is reported by putty terminal. When trying to ssh root@localhost from the local console - it works fine. It also works fine when I ssh otheruser@host from other host. So network connectivity issues are not guilty. The only error I am thinking of is: "Too many Authentication Failures for user root" although putty reported a different error.
This could happen if you have (default on my system) five or more DSA/RSA identity files stored in your .ssh directory. In this case if the -i option isn't specified at the command line the ssh client will first attempt to login using each identity (private key) and next prompt for password authentication. However, sshd drops the connection after five bad login attempts (again default may vary).
"Too many Authentication Failures for user root" means that Your SSH server's MaxAuthTries limit was exceeded.It happens so that Your client is trying to authenticate with all possible keys stored in /home/USER/.ssh/ .
Note: if you choose to use only the second option, and try to use ssh example.com you will still get errors (if that;s what brought you here), the short version will not give the errors, you can also use both options so you can ssh [email protected] without the errors.
This is typical problem when You have installed multiple keys or open multiple connections.Server checking step by step each key and if MaxAuthTries is setup on 3 then after first 3`rd tries will disconnect You. Typical ssh security.
I also faced the same issue. This can easily happen if you are using Pageant and have a large number of keys loaded into it, since these servers count each offer of a public key as an authentication attempt.
As @sufferer mentioned in another answer, some Linux distros include monitors to protect from brute force attacks on external visible services like SSH, for example DenyHosts or fail2ban. These monitors check the log files looking for failed attempts and add filters to block IP addresses that have too many failures (the number is configurable and independent from the sshd config).
If you have DenyHosts, the banned list is in the file /etc/hosts.deny; you can edit this file directly as root. To grant some IP a.b.c.d permanent access, you could add the line sshd:a.b.c.d to the file /etc/hosts.allow.
Note that increasing the number of retries allowed in the sshd configuration does not free banned IPs, only permits more failures in the same connection. If the number allowed is exceeded, the user/attacker simply reconnects again to try n times more.
I have a standard vagrant VM with an SSH key and I can SSH into it using Putty. While trying to get on it during deployment in PHPStorm I get too many authentication failures error. So I increased the MaxAuthTries in my sshd_config and then I got hit with Auth failed error and then Auth cancel.
What I think you might find is that the remote server is running fail2ban(*) and it "jailed" your IP after your successful login. You can test this by trying to log in again, and you will not even get the login prompt.
There are two solutions, you can either wait out the jail time, at which point things simply go back to normal, but jail time could be anything. Or you can find different computer to log in from, do that and "un-jail" your IP, in this case "different" is from the perspective of the remote server, so another computer behind the same firewall probably won't work either.
(*) fail2ban is a super handy daemon that can periodically check various log files and adjust firewall rules to make the server "disappear" when it detect potentially malicious behaviour from a client. On debian, it comes out of the box configured to detect multiple failed ssh logins from a particular IP, and after 3 (I think) it will drop all packets from that IP. Works brilliantly to stop those scripted, brute force attacks.
If this is from a VPS spun up by cloud provider then it may be because it's using fail2ban by default. SSH from another IP (or from provider's webportal if they have interactive ssh) and check to see if your IP was added to the sshd fail2ban jail:
[APPSERVER:APPSERVER_NOT_RESPONDING__S]
message = Appserver at %s never started up.
action = Set appServerProcessLogStderr to "true" under [settings] in web.conf. Restart, try the operation again, and review splunkd.log for any messages that contain "UiAppServer - From appserver".
severity = error
[APPLICATION_LICENSE:APP_LICENSE_SERVER_UNDEFINED__S]
message = The appLicenseHostPort setting in server.conf is undefined. Unless the connection is restored, all licensed apps will be disabled in %s day(s).
action = Check the appLicenseHostPort setting in server.conf or contact Splunk Support.
severity = error
[AUDIT:START_OF_EVENT_DROPS]
message = Now skipping indexing of internal audit events, because the downstream queue is not accepting data. Will keep dropping events until data flow resumes.
action = Review system health: ensure downstream indexing and/or forwarding are operating correctly.
severity = warn
capabilities = admin_all_objects
[BUCKET_CACHE:INDEXED_KV_LIMIT_REACHED]
message = The search you ran returned a number of fields that exceeded the current indexed field extraction limit.
severity = warn
action = To ensure that all fields are extracted for search, set limits.conf: [kv] / indexed_kv_limit to a number that is higher than the number of fields contained in the files that you index.
[CURSOREDSEARCH:SUBSECOND_ORDER]
message = Events might not be returned in sub-second order due to search memory limits. See search.log for more information.
action = Increase the value of the following limits.conf setting:[search]:max_rawsize_perchunk.
severity = error
capabilities = search
[DISPATCHCOMM:ASYNC_BUNDLE_REPLICATION]
message = Asynchronous bundle replication might cause (pre 4.2) search peers to run searches with different bundle/config versions. Results might not be correct.
severity = info
[DISPATCHCOMM:EXCLUDED_QUARANTINED_PEERS]
message = One or more peers has been excluded from the search because they have been quarantined. Use "splunk_server=*" to search these peers. This might affect search performance.
severity = warn
[DISPATCHCOMM:MAX_CONCURRENT_SEARCHES__S_LU_LU]
message = This search could not be dispatched because the role-based concurrency limit of historical searches for user "%s" has been reached (usage=%lu, quota=%lu).
action = Wait for some of your running historical searches to complete or ask your Splunk administrator to increase the search concurrency limit of historical searches for your role in authorize.conf.
severity = error
capabilities = search
help = learnmore.concurrent.search.limit
message_alternate = The maximum number of concurrent historical searches for this user based on their role quota has been reached.
[DISPATCHCOMM:MAX_CONCURRENT_SEARCHES_CLUSTER_WIDE__S_LU_LU]
message = This search could not be dispatched because the role-based concurrency limit of historical searches for user "%s" on this cluster has been reached (usage=%lu, quota=%lu).
action = Wait for some of your running historical searches to complete or ask your Splunk administrator to increase the search concurrency limit of historical searches for your role in authorize.conf.
severity = error
capabilities = search
help = learnmore.concurrent.search.limit
message_alternate = The maximum number of concurrent historical searches for this user on this cluster based on their role quota has been reached.
[DISPATCHCOMM:OVER_DISK_QUOTA__S_LU_LU]
message = This search could not be dispatched because the role-based disk usage quota of search artifacts for user "%s" has been reached (usage=%luMB, quota=%luMB).
action = Use the [[/app/search/job_managerJob Manager]] to delete some of your search artifacts, or ask your Splunk administrator to increase the disk quota of search artifacts for your role in authorize.conf.
severity = error
capabilities = search
message_alternate = The maximum disk usage quota for this user has been reached.
[DISPATCHCOMM:OVER_DISK_QUOTA_CLUSTER_WIDE__S_LU_LU]
message = This search could not be dispatched because the role-based disk usage quota of search artifacts for user "%s" on this cluster has been reached (usage=%luMB, quota=%luMB).
action = Use the [[/app/search/job_managerJob Manager]] to delete some of your search artifacts, or ask your Splunk administrator to increase the disk quota of search artifacts for your role in authorize.conf.
severity = error
capabilities = search
message_alternate = The maximum disk usage quota for this user on this cluster has been reached.
[DISPATCHCOMM:OVER_RT_SEARCH_QUOTA__S_LU_LU]
message = This search could not be dispatched because the role-based concurrency limit of real-time searches for user "%s" has been reached (usage=%lu, quota=%lu).
action = Use the [[/app/search/job_managerJob Manager]] to cancel some of your running real-time searches or ask your Splunk administrator to increase the search concurrency limit of real-time searches for your role in authorize.conf.
severity = error
capabilities = search
help = learnmore.concurrent.search.limit
message_alternate = The maximum number of concurrent real-time searches for this user based on their role quota has been reached.
[DISPATCHCOMM:OVER_RT_SEARCH_QUOTA_CLUSTER_WIDE__S_LU_LU]
message = This search could not be dispatched because the role-based concurrency limit of real-time searches for user "%s" on this cluster has been reached (usage=%lu, quota=%lu).
action = Use the [[/app/search/job_managerJob Manager]] to cancel some of your running real-time searches or ask your Splunk administrator to increase the search concurrency limit of real-time searches for your role in authorize.conf.
severity = error
capabilities = search
help = learnmore.concurrent.search.limit
message_alternate = The maximum number of concurrent real-time searches for this user on this cluster based on their role quota has been reached.