Sponsored Content
Full Discussion: Need help with script.
Top Forums Shell Programming and Scripting Need help with script. Post 302349990 by taekwondo on Wednesday 2nd of September 2009 12:57:54 PM
Old 09-02-2009
this is a small snippet Dan.

Illegal users from:
192.168.42.22 (impala.snas-net): 1 time

**Unmatched Entries**
pam_succeed_if(sshd:auth): error retrieving information about user henry : 1 time(s)

If I cat for illegal, I don't find out where the 'illegal' is coming from because the actual ip is on the next line. Or the next line, where I grep for unmatched but don't get the user Henry.

I'm fairly new to scripting or not very knowledgeable at this time. Thanks.

---------- Post updated at 12:57 PM ---------- Previous update was at 12:50 PM ----------

Here is another sample of the log where I want to grab the second line following the line I grepped for.

sshd:
Authentication Failures:
unknown (impala.snas-net): 1 Time(s)
Invalid Users:
Unknown Account: 1 Time(s)
 

5 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

create a shell script that calls another script and and an awk script

Hi guys I have a shell script that executes sql statemets and sends the output to a file.the script takes in parameters executes sql and sends the result to an output file. #!/bin/sh echo " $2 $3 $4 $5 $6 $7 isql -w400 -U$2 -S$5 -P$3 << xxx use $4 go print"**Changes to the table... (0 Replies)
Discussion started by: magikminox
0 Replies

2. Shell Programming and Scripting

Script will keep checking running status of another script and also restart called script at night

I am using blow script :-- #!/bin/bash FIND=$(ps -elf | grep "snmp_trap.sh" | grep -v grep) #check snmp_trap.sh is running or not if then # echo "process found" exit 0; else echo "process not found" exec /home/Ketan_r /snmp_trap.sh 2>&1 & disown -h ... (1 Reply)
Discussion started by: ketanraut
1 Replies

3. UNIX for Dummies Questions & Answers

Calling a script from master script to get value from called script

I am trying to call a script(callingscript.sh) from a master script(masterscript.sh) to get string type value from calling script to master script. I have used scripts mentioned below. #masterscript.sh ./callingscript.sh echo $fileExist #callingscript.sh echo "The script is called"... (2 Replies)
Discussion started by: Raj Roy
2 Replies

4. Shell Programming and Scripting

Shell script works fine as a standalone script but not as part of a bigger script

Hello all, I am facing a weird issue while executing a code below - #!/bin/bash cd /wload/baot/home/baotasa0/sandboxes_finance/ext_ukba_bde/pset sh UKBA_publish.sh UKBA 28082015 3 if then echo "Param file conversion for all the areas are completed, please check in your home directory"... (2 Replies)
Discussion started by: ektubbe
2 Replies

5. Shell Programming and Scripting

How to block first bash script until second bash script script launches web server/site?

I'm new to utilities like socat and netcat and I'm not clear if they will do what I need. I have a "compileDeployStartWebServer.sh" script and a "StartBrowser.sh" script that are started by emacs/elisp at the same time in two different processes. I'm using Cygwin bash on Windows 10. My... (3 Replies)
Discussion started by: siegfried
3 Replies
PAM_SUCCEED_IF(8)						     Linux-PAM							 PAM_SUCCEED_IF(8)

NAME
pam_succeed_if - test account characteristics SYNOPSIS
pam_succeed_if.so [flag...] [condition...] DESCRIPTION
pam_succeed_if.so is designed to succeed or fail authentication based on characteristics of the account belonging to the user being authenticated. One use is to select whether to load other modules based on this test. The module should be given one or more conditions as module arguments, and authentication will succeed only if all of the conditions are met. OPTIONS
The following flags are supported: debug Turns on debugging messages sent to syslog. use_uid Evaluate conditions using the account of the user whose UID the application is running under instead of the user being authenticated. quiet Don't log failure or success to the system log. quiet_fail Don't log failure to the system log. quiet_success Don't log success to the system log. audit Log unknown users to the system log. Conditions are three words: a field, a test, and a value to test for. Available fields are user, uid, gid, shell, home and service: field < number Field has a value numerically less than number. field <= number Field has a value numerically less than or equal to number. field eq number Field has a value numerically equal to number. field >= number Field has a value numerically greater than or equal to number. field > number Field has a value numerically greater than number. field ne number Field has a value numerically different from number. field = string Field exactly matches the given string. field != string Field does not match the given string. field =~ glob Field matches the given glob. field !~ glob Field does not match the given glob. field in item:item:... Field is contained in the list of items separated by colons. field notin item:item:... Field is not contained in the list of items separated by colons. user ingroup group User is in given group. user notingroup group User is not in given group. user innetgr netgroup (user,host) is in given netgroup. user notinnetgr group (user,host) is not in given netgroup. MODULE TYPES PROVIDED
All module types (account, auth, password and session) are provided. RETURN VALUES
PAM_SUCCESS The condition was true. PAM_AUTH_ERR The condition was false. PAM_SERVICE_ERR A service error occurred or the arguments can't be parsed correctly. EXAMPLES
To emulate the behaviour of pam_wheel, except there is no fallback to group 0: auth required pam_succeed_if.so quiet user ingroup wheel Given that the type matches, only loads the othermodule rule if the UID is over 500. Adjust the number after default to skip several rules. type [default=1 success=ignore] pam_succeed_if.so quiet uid > 500 type required othermodule.so arguments... SEE ALSO
glob(7), pam(7) AUTHOR
Nalin Dahyabhai <nalin@redhat.com> Linux-PAM 06/04/2011 PAM_SUCCEED_IF(8)
All times are GMT -4. The time now is 07:03 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy