Sponsored Content
Top Forums Shell Programming and Scripting How do I go about finding a value located in one file in another? Post 302258033 by mojoman on Thursday 13th of November 2008 05:07:41 PM
Old 11-13-2008
How do I go about finding a value located in one file in another?

Hi,

I have to determine which VALID users made a failed loggon attempts on our server.To make a long story short, I have isolated the list of all the usernames and number of attempts in one file, and have isolated the valid users who have made failed loggon attempts in another file. I now have to tell my script to match the valid users who have made failed loggon attempts to the entries that contain ALL users who made failed failed loggon attempts and the number of attempts. I was thinking of reading the file with valid users, reading line by line and grepping the username in the file that contains the failed usernames with number of attempts. I am new to shell scropting so I am not sure how to code this. Could someone provide an example please or suggest a better way to do what I want?

So if I have MARK in file 1 I need to match it with MARK 2 in file 2 and then output MARK 2 to another file. 2 being the # of failed loggon attempt.

Thanks,

Thanks,

Mohit

Last edited by mojoman; 11-13-2008 at 06:17 PM..
 

10 More Discussions You Might Find Interesting

1. Solaris

Where Xorg X-Lock file is located in Solaris?

I am using Xorg server with Solaris 10. After unnormal poweroff dtlogin tells: "The X-server can not be started on display :0" I am absolutelly sure it is because there is still a X-lock file from the previouse X-session somewhere, but I do not know where is it located in Solaris! :confused: (2 Replies)
Discussion started by: eugrus
2 Replies

2. Shell Programming and Scripting

Pls Help - Need to edit file located in several directories

I need to update an entry called "mail.RiskNavigatorFromEmailAddress" in all of the "Application.properties" files below, which are located in several different directories... Each of these Application.properties files has the following entry: ... (3 Replies)
Discussion started by: kthatch
3 Replies

3. UNIX for Dummies Questions & Answers

Deleting a file located on another server

Hi, I have successfully copied a file from one server to another using following command. user1@server1# scp test.jsp user2@server2:/home/ Now i want to delete that copied file(test.jsp) from "server2" by running some command from server1. Please help... (1 Reply)
Discussion started by: SanketJOSHI
1 Replies

4. Shell Programming and Scripting

Deleting a file located on another server

Hi, I have successfully copied a file from one server to another using following command. user1@server1# scp test.jsp user2@server2:/home/ Now i want to delete that copied file(test.jsp) from "server2" by running some command from server1. Please help... (2 Replies)
Discussion started by: SanketJOSHI
2 Replies

5. Shell Programming and Scripting

use awk to read randomly located columns in an excel file

Hi, I have an excel file that have a random count of columns/fields and what im trying to do is to only retrieve all the rows under 2 specific field headers. I can use the usually command for awk which is awk 'print{ $1 $2}' > output.txt, but the location of the 2 specific field headers is... (9 Replies)
Discussion started by: mdap
9 Replies

6. UNIX for Dummies Questions & Answers

how to know the device on which the file is located

Hi, i want to know on which device a file is located is there any command or anyway to know it thanks santosh (5 Replies)
Discussion started by: santosh149
5 Replies

7. Shell Programming and Scripting

Executing KSH batch file located in specific folder

Ok apologies if this is trivial or doesn't make sense but I am quite new to korn shells; So I have a .ksh batch file located in a folder of my choosing, I want to run this file in a korn shell. The problem though is that I want to get VBA code to do this. I have (VBA) code which opens command... (1 Reply)
Discussion started by: cjsewell
1 Replies

8. UNIX for Advanced & Expert Users

Need help to change the content for remote located file

Hi All, I have one file that sits on 4 diffrent servers, those servers are diffrent region based and they are authentication protected and that file has a diff port numbers, so when run the script it must ask my login details,region of server and port no for that file once it took from me... (1 Reply)
Discussion started by: tmarjuna
1 Replies

9. Shell Programming and Scripting

Need help to change the content for remote located file

Hi All, I have a file that sits on 4 diffrent servers, those servers are diffrent region based and they are authentication protected and that file has a diff port numbers, so when run the script it must ask my login details,region of server and port no for that file once it took from me it... (1 Reply)
Discussion started by: tmarjuna
1 Replies

10. UNIX for Dummies Questions & Answers

sudo dmidecode where is the file located ?

Been through all my /sys /sbin /bin directories and can't seem to find it. (2 Replies)
Discussion started by: jcnewton13
2 Replies
PAM_ABL(8)							 Linux-PAM Manual							PAM_ABL(8)

NAME
pam_abl - PAM Auto Blacklist Module SYNOPSIS
Provides auto blacklisting of hosts and users responsible for repeated failed authentication attempts. Generally configured so that blacklisted users still see normal login prompts but are guaranteed to fail to authenticate. This functionality is only available to services which call PAM as root. If pam_abl is called for uid != 0 it will silently succeed. DESCRIPTION
Brute force password discovery attacks involve repeated attempts to authenticate against a service using a dictionary of common passwords. While it is desirable to enforce strong passwords for users this is not always possible and in cases where a weak password has been used brute force attacks can be effective. The pam_abl module monitors failed authentication attempts and automatically blacklists those hosts (and accounts) that are responsible for large numbers of failed attempts. Once a host is blacklisted it is guaranteed to fail authentication even if the correct credentials are provided. Blacklisting is triggered when the number of failed authentication attempts in a particular period of time exceeds a predefined limit. Hosts which stop attempting to authenticate will, after a period of time, be un-blacklisted. Commands can be specified which will be run when a host or user switches state from being blocked to clear or clear to blocked. See below or the pam_abl.conf(5) manpage for the details. If pam_abl is called for uid != 0 it will silently succeed. If this was not the case it would be possible for a malicious local user to poison the pam_abl data by, for example, discovering the names of the hosts from which root typically logs in and then constructing PAM authentication code to lock out root login attempts from those hosts. OPTIONS
Name Arguments Description debug None Enable debug output to syslog. expose_account None Ignored no_warn None Disable warnings which are otherwise output to syslog. try_first_pass None Ignored use_first_pass None Ignored use_mapped_pass None Ignored config Path to the configuration file. The configuration file contains additional arguments. In order for the pam_abl command line tool to work correctly most of the configuration should be placed in the config file rather than being provided by arguments. The format of the config file is described below. host_db Path to host database file. Path to the Berkeley DB which is used to log the host responsible for failed authentication attempts. host_purge Purge time for the host database. Defines how long failed hosts are retained in the host database. Defaults to 1 day. host_rule Rule for host blacklisting. The rule (see below for format) which defines the conditions under which a failed hosts will be blackisted. host_blk_cmd Host block command Command that should be run when a host is checked, and is currently blocked. Within the command, the strings %u, %h and %s are substituted with username, host and service. Not all need to be used. If substitution is called for, but there is no iformation for that field, the command will not run. host_clr_cmd Host block command Command that should be run when a host is checked, and is currently clear. Within the command, the strings %u, %h and %s are substituted with username, host and service. Not all need to be used. If substitution is called for, but there is no iformation for that field, the command will not run. user_db Path to user database file. Path to the Berkeley DB which is used to log the user responsible for failed authentication attempts. user_purge Purge time for the user database. Defines how long failed users are retained in the user database. Defaults to 1 day. user_rule Rule for user blacklisting. The rule (see below for format) which defines the conditions under which a failed users will be blackisted. user_blk_cmd Host block command Command that should be run when a user is checked, and is currently blocked. Within the command, the strings %u, %h and %s are substituted with username, host and service. Not all need to be used. If substitution is called for, but there is no iformation for that field, the command will not run. user_clr_cmd Host block command Command that should be run when a user is checked, and is currently clear. Within the command, the strings %u, %h and %s are substituted with username, host and service. Not all need to be used. If substitution is called for, but there is no iformation for that field, the command will not run. USAGE
Typically pam_abl.so is added to the auth stack as a required module just before whatever modules actually peform authentication. Here's a fragment of the PAM config for a production server that is running pam_abl: auth required /lib/security/pam_env.so auth required /lib/security/pam_abl.so config=/etc/security/pam_abl.conf auth sufficient /lib/security/pam_unix.so likeauth nullok auth required /lib/security/pam_deny.so Although all of accepted arguments can be supplied here they will usually be placed in a separate config file and linked to using the config argument as in the above example. The pam_abl command line tool reads the external config file (/etc/security/pam_abl.conf in this case) to find the databases so in order for it work correctly an external config should be used. EXAMPLES
auth required /lib/security/pam_env.so auth required /lib/security/pam_abl.so config=/etc/security/pam_abl.conf auth sufficient /lib/security/pam_unix.so likeauth nullok auth required /lib/security/pam_deny.so SEE ALSO
pam_abl.conf(5), pam_abl(1) AUTHORS
Andy Armstrong <andy@hexten.net> Chris Tasma <pam-abl@deksai.com> GNU
01/13/2010 PAM_ABL(8)
All times are GMT -4. The time now is 09:24 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy