I run into this on a regular basis (dbas\developers constantly forgetting their passwords) so I have it scripted. You're more than welcomed to it:
Code:
#!/usr/bin/perl
#
# clrlogin
#
# description: simple script to reset unsuccessful logins for a given user
#
#
###########################################################################
use strict;
# set some defaults
my $user;
my $ulogcnt;
my $ulogcntrst;
# check the command line
if(! @ARGV) {
print "\nUsage: clrlogin 'username'\n\n";
exit(1);
} elsif (($#ARGV+1) == 1) {
# store the given username
$user = shift @ARGV;
} else {
print "\nIncorrect number of arguments!\n\n";
exit(1);
}
# display the number of unsuccessful logins for the
# given user
$ulogcnt = `lssec -f /etc/security/lastlog -a "unsuccessful_login_count" -s $user`;
print "\n$ulogcnt\n\n";
# offer to reset unsuccessful logins to 0 or forgeddaboutit
print "Reset unsuccessful logins for $user? [y,n] ";
chomp(my $answer = <STDIN>);
if($answer =~ /^n$/i) {
print "\nUnsuccessful logins not reset for $user.\n";
exit(1);
} elsif ($answer =~ /^y$/i) {
print "\nResetting unsuccessful logins for $user.\n";
$ulogcntrst = `chsec -f /etc/security/lastlog -a "unsuccessful_login_count=0" -s $user"`;
print "$ulogcntrst\n";
}
# done
exit(0);
hi, can someone tell me " how to reset failed login in solaris 8.0"
a user is not able to login and inspite of my changing password cannot.
I believe it must be because the user tried many attempts.
how do i reset the failed login for the user.
Thanks!
karthik (2 Replies)
Hi,
Would appreciate it if someone could shed me some light here as I'm yet to find any related information in this forum with regards to my problem.
Basically, I would like to display "Last Unsuccessful login" information when a user successfully logs-in to the system. I can't seem to find... (2 Replies)
Hi guys, Can you please help me.
I have SUN V100 server running solaris 8.
I also have a Redhat Linux 6.2 machine and a windows XP machine on the network.
I'm trying to copy files from the Linux and XP machines to the V100 server.
When I try to ftp to the solaris machine, I'm challenged... (2 Replies)
Hi,
I managed to install OpenImsCore and XLite, and then I tried to log in using Bob and Alice usernames, but it doesn't work.
I am using Ubuntu 8.04 = Kubuntu.
I tried everything I found on Google (changing security settings in HSS and scscf to Digest-MD5 was the last thing I did), but... (0 Replies)
Dears,
i am trying to recording failed login
this is the steps which i do:-
1) touch /var/adm/logilog
2) chown root:sys /var/adm/loginlog
3) chmod 600 /var/adm/loginlog
ls -l /var/adm/loginlog
-rw------- 1 root sys 0 Jul 21 03:52 /var/adm/loginlog
4) change this value in... (3 Replies)
I have an application (EXE file) in a Windows 2003 server. Through a DOS batch script, I called that application file using UNC path and working fine when locally login. But got failed when I tried the same batch script on remote login. The login id has been provided all the below rights:
- Log on... (0 Replies)
Holla!
Sorry to spam the board with all my Solaris 2.6 questions (I just found this forum). My most recent problem is that not ALL failed log-ins are getting logged in /var/log/authlog. It seems to work fine for the "su" command from a non-root user, but the actual "login" command or a desktop... (4 Replies)
Dear Unix Team,
This is sudhansu once again. I need some tips on below issue.
Sometimes we got calls from customer that their console got hangged means they are not able to access the server through console ip.
in that case "resetsc -y" will resolve the issue.
2. But couple of days... (2 Replies)
Hi,
Can someone tell me the command to do this in solaris 5.10 please? I've trawled around the internet for ages but all I can find is the AIX command...
Thanks (2 Replies)
How to clear IPCS queue count in server? (2 Replies)
Discussion started by: Arasu123
2 Replies
LEARN ABOUT CENTOS
logins
logins(1M) System Administration Commands logins(1M)NAME
logins - list user and system login information
SYNOPSIS
/usr/bin/logins [-admopstux] [-g group...] [-l login_name...]
DESCRIPTION
This command displays information on user and system logins known to the system. Contents of the output is controlled by the command
options and can include the following: user or system login, user id number, passwd account field value (user name or other information),
primary group name, primary group id, multiple group names, multiple group ids, home directory, login shell, and four password aging param-
eters. The default information is the following: login id, user id, primary group name, primary group id and the account field value. Out-
put is sorted by user id, system logins, followed by user logins.
OPTIONS
Options may be used together. If so, any login that matches any criteria are displayed.
The following options are supported:
-a Add two password expiration fields to the display. The fields show how many days a password can remain unused before it
automatically becomes inactive, and the date that the password expires.
-d Selects logins with duplicate uids.
-g group Selects all users belonging to group, sorted by login. Multiple groups can be specified as a comma-separated list. When
the -l and -g options are combined, a user is only listed once, even if the user belongs to more than one of the selected
groups.
-l login_name...Selects the requested login. Multiple logins can be specified as a comma-separated list. Depending on the nameservice
lookup types set in /etc/nsswitch.conf, the information can come from the /etc/passwd and /etc/shadow files and other
nameservices. When the -l and -g options are combined, a user is only listed once, even if the user belongs to more than
one of the selected groups.
-m Displays multiple group membership information.
-o Formats output into one line of colon-separated fields.
-p Selects logins with no passwords.
-s Selects all system logins.
-t Sorts output by login instead of by uid.
-u Selects all user logins.
-x Prints an extended set of information about each selected user. The extended information includes home directory, login
shell and password aging information, each displayed on a separate line. The password information consists of password
status (PS for password, NP for no password or LK for locked). If the login is passworded, status is followed by the date
the password was last changed, the number of days required between changes, and the number of days allowed before a change
is required. The password aging information shows the time interval that the user receives a password expiration warning
message (when logging on) before the password expires.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWcsu |
+-----------------------------+-----------------------------+
SEE ALSO attributes(5)SunOS 5.10 5 Jul 1990 logins(1M)