User account get locked due to strange behaviours


 
Thread Tools Search this Thread
Operating Systems Solaris User account get locked due to strange behaviours
# 1  
Old 06-25-2014
User account get locked due to strange behaviours

I am facing strange problem where after three failed login attempt user password must be locked. Actually what is happening, when I take the putty session of the server & enter user name on the prompt at the login prompt & then press enter to enter the password at this time when I checked the /etc/shadow file against the user name I can see that 1 failed login attempt has been made even when I have not press the enter button after giving password.

So then again if I take the another same user session on another putty for the same server after enter the same user again and before giving password, second failed login attempt will be shown in the /etc/shadow file. After entering the wrong passwd in this session and press enter after giving the password , user account get lock as in /etc/shadow file it shows three failed login attempts

As per my knowledge if user enter the three consecutive wrong password attempts. then only user password must be locked. but this is not happening in my this particular server.

Code:
bash-3.2# cat /etc/default/login
#ident  "@(#)login.dfl  1.14    04/06/25 SMI"
#
# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
# Use is subject to license terms.

# Set the TZ environment variable of the shell.
#
#TIMEZONE=EST5EDT

# ULIMIT sets the file size limit for the login.  Units are disk blocks.
# The default of zero means no limit.
#
#ULIMIT=0

# If CONSOLE is set, root can only login on that device.
# Comment this line out to allow remote login by root.
#
#CONSOLE=/dev/console

# PASSREQ determines if login requires a password.
#
PASSREQ=YES

# ALTSHELL determines if the SHELL environment variable should be set
#
ALTSHELL=YES

# PATH sets the initial shell PATH variable
#
#PATH=/usr/bin:

# SUPATH sets the initial shell PATH variable for root
#
#SUPATH=/usr/sbin:/usr/bin

# TIMEOUT sets the number of seconds (between 0 and 900) to wait before
# abandoning a login session.
#
#TIMEOUT=300

# UMASK sets the initial shell file creation mode mask.  See umask(1).
#
#UMASK=022

# SYSLOG determines whether the syslog(3) LOG_AUTH facility should be used
# to log all root logins at level LOG_NOTICE and multiple failed login
# attempts at LOG_CRIT.
#
SYSLOG=YES

# SLEEPTIME controls the number of seconds that the command should
# wait before printing the "login incorrect" message when a
# bad password is provided.  The range is limited from
# 0 to 5 seconds.
#
#SLEEPTIME=4

# DISABLETIME  If present, and greater than zero, the number of seconds
# login will wait after RETRIES failed attempts or the PAM framework returns
# PAM_ABORT. Default is 20. Minimum is 0. No maximum is imposed.
#
#DISABLETIME=20

# RETRIES determines the number of failed logins that will be
# allowed before login exits. Default is 5 and maximum is 15.
# If account locking is configured (user_attr(4)/policy.conf(4))
# for a local user's account (passwd(4)/shadow(4)), that account
# will be locked if failed logins equals or exceeds RETRIES.
#
RETRIES=3
#
# The SYSLOG_FAILED_LOGINS variable is used to determine how many failed
# login attempts will be allowed by the system before a failed login
# message is logged, using the syslog(3) LOG_NOTICE facility.  For example,
# if the variable is set to 0, login will log -all- failed login attempts.
#
#SYSLOG_FAILED_LOGINS=5
bash-3.2#
bash-3.2#
bash-3.2# cat /etc/security/policy.conf
#
#
# Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
#
# /etc/security/policy.conf
#
# security policy configuration for user attributes. see policy.conf(4)
#
#ident  "@(#)policy.conf        1.13    11/11/18 SMI"
#
AUTHS_GRANTED=solaris.device.cdrw
PROFS_GRANTED=Basic Solaris User

# crypt(3c) Algorithms Configuration
#
# CRYPT_ALGORITHMS_ALLOW specifies the algorithms that are allowed to
# be used for new passwords.  This is enforced only in crypt_gensalt(3c).
#
CRYPT_ALGORITHMS_ALLOW=1,2a,md5

# To deprecate use of the traditional unix algorithm, uncomment below
# and change CRYPT_DEFAULT= to another algorithm.  For example,
# CRYPT_DEFAULT=1 for BSD/Linux MD5.
#
#CRYPT_ALGORITHMS_DEPRECATE=__unix__

# The Solaris default is the traditional UNIX algorithm.  This is not
# listed in crypt.conf(4) since it is internal to libc.  The reserved
# name __unix__ is used to refer to it.
#
CRYPT_DEFAULT=__unix__
#
# These settings determine the default privileges users have.  If not set,
# the default privileges are taken from the inherited set.
# There are two different settings; PRIV_DEFAULT determines the default
# set on login; PRIV_LIMIT defines the Limit set on login.
# Individual users can have privileges assigned or taken away through
# user_attr.  Privileges can also be assigned to profiles in which case
# the users with those profiles can use those privileges through pfexec(1m).
# For maximum future compatibility, the specifications should
# always include "basic" or "all"; privileges should then be removed using
# the negation.  E.g., PRIV_LIMIT=all,!sys_linkdir takes away only the
# sys_linkdir privilege, regardless of future additional privileges.
# Similarly, PRIV_DEFAULT=basic,!file_link_any takes away only the
# file_link_any privilege from the basic privilege set; only that notation
# is immune from a future addition of currently unprivileged operations to
# the basic privilege set.
# NOTE: removing privileges from the the Limit set requires EXTREME care
# as any set-uid root program may suddenly fail because it lacks certain
# privilege(s).
#
#PRIV_DEFAULT=basic
#PRIV_LIMIT=all
#
# LOCK_AFTER_RETRIES specifies the default account locking policy for local
# user accounts (passwd(4)/shadow(4)).  The default may be overridden by
# a user's user_attr(4) "lock_after_retries" value.
# YES enables local account locking, NO disables local account locking.
# The default value is NO.
#
LOCK_AFTER_RETRIES=YES
# Restrictive Locking: Passwd and account creation semantics
# changed in Oracle Solaris 10 9/10 and Oracle Solaris 10 8/11 to
# a more restrictive model.
#
# If this option is set to "NO" then the behavior from
# Solaris 10 10/09 (s10s_u8wos_08a, s10x_u8wos_08a) will be in effect:
# -- Assigning a new password will unlock a locked account
# -- No Login accounts will be lockable via "passwd -l."
# -- New accounts will have "*LK*" in the password field.
# -- passwd -l returns 0 if the account is already locked.
#
# If set to "YES:
# -- Assigning a new password to a locked account will replace the password
#    but retain the lock.
# -- No Login accounts (see the -N option of passwd(1)) cannot be locked
#    directly; passwd -d followed by passwd -l is required.
# -- New accounts will have "UP" in the password field
# --  passwd -l returns a non-zero value if nothing changes.
#
# For more information, see passwd(1), policy.conf(4), and  "Assigning
# a New Password Does Not Unlock a Locked Account" in the  Oracle
# Solaris 10 8/11 What's New section on  Security Enhancements.
#
# Default is YES
#
# This option is Obsolete [ see attributes(5) ] and has been removed
# from a newer release.
#RESTRICTIVE_LOCKING=YES
bash-3.2#

# 2  
Old 06-25-2014
Have you considered the possibility that Putty is causing the problem?

Perhaps try the user login from the console (and check shadow from another route (remote login?) to see if it still happens.

Putty can be configured in a multitude of ways. Perhaps Putty is sending a lf (line feed) character or something like that.

I would eliminate Putty from the equation first.
# 3  
Old 06-25-2014
Thanks for the reply...Well this server is an Ldom Server. when we are trying to login from the base server to ldom we are not facing this issue through "telnet localhost 5000". And account get locked exactly after three wrong password.


And moreover, we are not facing this issue on anyother server where after three wrong login attempts user account gets locked. It means our Putty configuartion is correct.
# 4  
Old 06-25-2014
I understand what you are saying. I do not have an immediate response that would indicate a Solaris issue.

My point however was that some terminal types (Putty setting) are expected to send CR/LF whilst others send only CR.

If there is "disagreement" between terminal and system and the terminal is sending CR/LF then the CR could be taken as the end of the userid and the LF as the end of the password; thereby entering an incorrect null password which after three times would lock out the account.

Let's wait and hear the views of others on this and whether anyone has seen this issue before.
# 5  
Old 06-26-2014
If you try to ssh with specifed user from one Solaris box to another, are you experiencing the same problems ?
Can you also test with other clients or emulators besides putty (winscp, cygwin or alike) ?

Regards
Peasant.
# 6  
Old 06-26-2014
Can you check the logs and see whether the failed logins are via keyboard interactive? Do you have ftp/sftp or key authentication?
# 7  
Old 06-27-2014
Yes still the same problem exist when I tried to login from another solaris host to this server. This same problem is coming from multiple windows desktop as well.

I tried through winscp also & still same problem is coming.

After giving the right password of the user, last column of the /etc/shadow file become null again.


Please also find the sshd_config file output as well

Code:
bash-3.2# cat /etc/ssh/sshd_config
#
# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
# Use is subject to license terms.
#
# ident "@(#)sshd_config        1.8     04/05/10 SMI"
#
# Configuration file for sshd(1m)
# Protocol versions supported
#
# The sshd shipped in this release of Solaris has support for major versions
# 1 and 2.  It is recommended due to security weaknesses in the v1 protocol
# that sites run only v2 if possible. Support for v1 is provided to help sites
# with existing ssh v1 clients/servers to transition.
# Support for v1 may not be available in a future release of Solaris.
#
# To enable support for v1 an RSA1 key must be created with ssh-keygen(1).
# RSA and DSA keys for protocol v2 are created by /etc/init.d/sshd if they
# do not already exist, RSA1 keys for protocol v1 are not automatically created.
# Uncomment ONLY ONE of the following Protocol statements.
# Only v2 (recommended)
Protocol 2
# Both v1 and v2 (not recommended)
#Protocol 2,1
# Only v1 (not recommended)
#Protocol 1
# Listen port (the IANA registered port number for ssh is 22)
Port 22
# The default listen address is all interfaces, this may need to be changed
# if you wish to restrict the interfaces sshd listens on for a multi homed host.
# Multiple ListenAddress entries are allowed.
# IPv4 only
#ListenAddress 0.0.0.0
# IPv4 & IPv6
ListenAddress ::
# Port forwarding
AllowTcpForwarding no
# If port forwarding is enabled, specify if the server can bind to INADDR_ANY.
# This allows the local port forwarding to work when connections are received
# from any remote host.
GatewayPorts no
# X11 tunneling options
X11Forwarding yes
X11DisplayOffset 10
X11UseLocalhost yes
# The maximum number of concurrent unauthenticated connections to sshd.
# start:rate:full see sshd(1) for more information.
# The default is 10 unauthenticated clients.
#MaxStartups 10:30:60
# Banner to be printed before authentication starts.
#Banner /etc/issue
# Should sshd print the /etc/motd file and check for mail.
# On Solaris it is assumed that the login shell will do these (eg /etc/profile).
PrintMotd no
# KeepAlive specifies whether keep alive messages are sent to the client.
# See sshd(1) for detailed description of what this means.
# Note that the client may also be sending keep alive messages to the server.
KeepAlive yes
# Syslog facility and level
SyslogFacility auth
LogLevel info
#
# Authentication configuration
#
# Host private key files
# Must be on a local disk and readable only by the root user (root:sys 600).
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
# Default Encryption algorithms and Message Authentication codes
#Ciphers        aes128-ctr,aes128-cbc,arcfour,3des-cbc,blowfish-cbc
#MACS   hmac-md5,hmac-sha1,hmac-sha1-96,hmac-md5-96
# Length of the server key
# Default 768, Minimum 512
ServerKeyBits 768
# sshd regenerates the key every KeyRegenerationInterval seconds.
# The key is never stored anywhere except the memory of sshd.
# The default is 1 hour (3600 seconds).
KeyRegenerationInterval 3600
# Ensure secure permissions on users .ssh directory.
StrictModes yes
# Length of time in seconds before a client that hasn't completed
# authentication is disconnected.
# Default is 600 seconds. 0 means no time limit.
LoginGraceTime 600
# Maximum number of retries for authentication
# Default is 6. Default (if unset) for MaxAuthTriesLog is MaxAuthTries / 2
MaxAuthTries    6
MaxAuthTriesLog 3
# Are logins to accounts with empty passwords allowed.
# If PermitEmptyPasswords is no, pass PAM_DISALLOW_NULL_AUTHTOK
# to pam_authenticate(3PAM).
PermitEmptyPasswords yes
# To disable tunneled clear text passwords, change PasswordAuthentication to no.
PasswordAuthentication yes
# Use PAM via keyboard interactive method for authentication.
# Depending on the setup of pam.conf(4) this may allow tunneled clear text
# passwords even when PasswordAuthentication is set to no. This is dependent
# on what the individual modules request and is out of the control of sshd
# or the protocol.
PAMAuthenticationViaKBDInt yes
# Are root logins permitted using sshd.
# Note that sshd uses pam_authenticate(3PAM) so the root (or any other) user
# maybe denied access by a PAM module regardless of this setting.
# Valid options are yes, without-password, no.
PermitRootLogin yes
# sftp subsystem
Subsystem       sftp    internal-sftp

# SSH protocol v1 specific options
#
# The following options only apply to the v1 protocol and provide
# some form of backwards compatibility with the very weak security
# of /usr/bin/rsh.  Their use is not recommended and the functionality
# will be removed when support for v1 protocol is removed.
# Should sshd use .rhosts and .shosts for password less authentication.
IgnoreRhosts yes
RhostsAuthentication no
# Rhosts RSA Authentication
# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts.
# If the user on the client side is not root then this won't work on
# Solaris since /usr/bin/ssh is not installed setuid.
RhostsRSAAuthentication no
# Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication.
#IgnoreUserKnownHosts yes
# Is pure RSA authentication allowed.
# Default is yes
RSAAuthentication yes
bash-3.2#

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Locked out of server due to utmp growing out of control

:(Dear Solaris Experts, The file /var/adm/utmpx is steadily growing on our standbye Sun Sparc T5220 Solaris 10 server. I have tried everything such as the following steps without success: root@rainbow # uname -a SunOS rainbow 5.10 Generic_141444-09 sun4v sparc... (2 Replies)
Discussion started by: gjackson123
2 Replies

2. Solaris

Particular user account shouldn't be locked after entering wrong passwd specfic no. times

Hi all In my system we have implemented user lockout feature after 3 failure attempt if he tries to login directly or if he run the any command through sudo and enter wrong password thrice. Now I have requirement in which particular user account shouldn't be locked when he run the command... (1 Reply)
Discussion started by: sb200
1 Replies

3. UNIX for Dummies Questions & Answers

Account is locked or login administratively denied

Hi, When I am trying to do ssh to a server it shows below error. Key setup is all good and it used to work well few days back. Now suddenly I am getting this error. ssh -i <private_key> <id>@<hostname> Received disconnect from <hostname> Account is locked or login administratively... (1 Reply)
Discussion started by: mahish20
1 Replies

4. UNIX for Dummies Questions & Answers

How do i list all locked account in linux?

Hi How do i list all locked account in my linux distributiion I have tried passwd -S -a but it seems to not working . My distribution details. # lsb_release -a LSB Version: :core-3.1-ia32:core-3.1-noarch:graphics-3.1-ia32:graphics-3.1-noarch Distributor ID: OracleVMserver... (3 Replies)
Discussion started by: pinga123
3 Replies

5. Solaris

Banner for Locked Account

Hi, I have enable Account lock for failed login attempts. I have configured 1) /etc/security/policy.conf 2)/etc/default/login To lock an account if it make multiple incorrect attempts to login to Solaris 10 server. I can see the account gets locked in /etc/shadow. I would like to... (1 Reply)
Discussion started by: menonk
1 Replies

6. UNIX for Dummies Questions & Answers

Difference between : Locked User Account & Disabled User Accounts in Linux ?

Thanks AVKlinux (3 Replies)
Discussion started by: avklinux
3 Replies

7. AIX

account is always locked out

we have a user name "Test1" that account is alwyas locked out. The user has been used to many servers to ftp a file from the main server. i already increase the MaxStartups to 99. And still after how many days account will locked. (3 Replies)
Discussion started by: invinzin21
3 Replies

8. Linux

Locked out of Mandrake 9.1 user account

Hi all, I've been using linux/unix now only for a couple of months and was doing ok until about 30 minutes ago... I needed to reboot into my windows 2000 partition, so, in a terminal I typed: shutdown -r now which duly rebooted the PC for me. On getting to the OS selection screen I... (5 Replies)
Discussion started by: alarmcall
5 Replies

9. AIX

root account has been locked

I'am set the root account locked ON, using smitty, so I can't login or su with root user in my AIX system, some one can help me to unlock root account login ???, sample : :~>su root's Password: 3004-301 Your account has been locked; please see the system administrator. 3004-501 Cannot su to... (1 Reply)
Discussion started by: Maker
1 Replies

10. UNIX for Dummies Questions & Answers

How to Enable locked root account

Hi Every one I disable the root account entering wrong password for many time How can I enable the root account I am using Tru64 Unix V4.0G Thank you (2 Replies)
Discussion started by: Syed_45
2 Replies
Login or Register to Ask a Question