Sponsored Content
Top Forums UNIX for Dummies Questions & Answers kicking a telneted user from the system Post 31074 by Kelam_Magnus on Thursday 31st of October 2002 03:53:52 PM
Old 10-31-2002
Do you want this to be based on a timeout period or are you just intending to remove users before you shutdown the box for maintenance?

Here is a script that you can modify for deleting inactive users. Not mine but useful.
Code:
******************cut here********************
# killlogin  --  kills login shell of anyone idle more than MIN minutes
#
# MIN = 30 for 30 minutes, 100 for 1 hour, 220 for 2 hour and 20 minutes
#
#-------------------------------------------------------------------------o
#
LOG=/tmp/killpid`date +"%a"`
# if you put LOG in other than tmp set up cron job to clean it out
# put the time at the beginning of the run
date +"%r" >> $LOG
# who -u gets list of ids and idle times
/bin/who -u | /bin/sed 's/://g' | tee -a $LOG  |
#----------
while read info
do
        set $info
  user="${1}"
        #echo \$user is $user

case $user in

        root) MIN=999999;;               # don't time out this user
        user1)  MIN=400 ;;               # don't time out this user for 4 hrs
        user2)  MIN=800 ;;               # don't time out this user for 8 hrs
        user3)  MIN=800 ;;               # don't time out this user for 8 hrs
        oracle )  MIN=800 ;;               # don't time out this user for 8 hrs
        *)  MIN=30 ;;                    # everyone else gets 30 minutes
esac

#echo \$time is $time

#echo \$MIN is $MIN
    TTY=$2
    if [ "${time}" -gt ${MIN} ]     # is time greater than limit in $MIN
    then
                /bin/kill -1 $7 
    fi
done

added code tags for readability --oombera

Last edited by oombera; 02-18-2004 at 02:15 PM..
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Kicking users off

Hello, how do i kick users off line. when i type w i see Mike pts/0 leg-64 11:28pm 0.00s 0.15s 0.01s w root pts/1 :0 11:31pm 1:13 0.06s 0.02s vi /etc/ftpaccess i want to boot Mike offline...how do i do that? many thanks (5 Replies)
Discussion started by: xNYx
5 Replies

2. Solaris

How to check the last login user were doing in the system

Hi, I'm new to solaris/ Unix and would like to know how to check in the system what was the last login user were doing. Is there any way to check this? Thanks in advanced. (1 Reply)
Discussion started by: raziayub
1 Replies

3. UNIX for Advanced & Expert Users

user is not able to FTP to system.

Helo, I have created one group called RBAC.(roll back access control) Now when I created user of RBAC its entry in /etc/passwd file is given below: roleadm:x:120:109:RBAC User:/home/pds_RBAC:/bin/false I have keep at the end /bin/false because I dont want to give direct login to the user... (2 Replies)
Discussion started by: amitpansuria
2 Replies

4. SCO

SCO console login keeps kicking me back out!! help

OK, I installed a new KVM switch and have 3 IBM servers all running SCO unix attached to it among some other servers... everything works fine except for just one of the SCO servers (all the same hardware) will kick me back out after I login using the console... I will login and it will take me... (4 Replies)
Discussion started by: herot
4 Replies

5. Solaris

add administrator user to system

Hello I have a new job and I need change the last user administrator, I dont know if is easier change some things about this user or add my user in the group with every permission, how can I do it. I dont know which is the group. I think is no only useradd en after modify /etc/passwd. Tank... (14 Replies)
Discussion started by: cata
14 Replies

6. Programming

Best way to check for system user and password in C

Hello, I'm implementing a very simple FTP client, and to do the login I would like to check against system users instead of using my own database, so that I can give the proper permissions to the newly created process that I spawn with fork. What's the best way for doing this in C? I've read... (4 Replies)
Discussion started by: royger
4 Replies

7. Shell Programming and Scripting

find a user on the system

i am prompting for a name to search. read user if then however, i get this error: please enter a username on the system: fool menu_script2.sh: line 123: (4 Replies)
Discussion started by: icelated
4 Replies

8. BSD

single user mode under system v

Hello! I am new to the forum and I need help on restoring root user's password or access the form of single user mode under operating system very long-standing family bsd - Unix system V I think it's also called srv4. I managed to enter the owner of IPL, and a moment after the rise of system... (2 Replies)
Discussion started by: hmalool
2 Replies

9. UNIX for Advanced & Expert Users

How to know which user is messing up with the system?

Hello, In our environment some users mess up with the system ( install / uninstall ) software.. unfortunately the root is open to several users (several of them have sudo access) How to track which user is trying to do this ( I'd like to know which user and what ipaddress. ) Experts please... (2 Replies)
Discussion started by: ramky79
2 Replies
poterminology(1)					      Translate Toolkit 1.9.0						  poterminology(1)

NAME
poterminology - reads a set of .po or .pot files to produce a pootle-terminology.pot SYNOPSIS
poterminology [--version] [-h|--help] [--manpage] [--progress PROGRESS] [--errorlevel ERRORLEVEL] [-i|--input] INPUT [-x|--exclude EXCLUDE] [-o|--output] OUTPUT [-u|--update UPDATEFILE] [-S|--stopword-list STOPFILE] [-F|--fold-titlecase] [-C|--preserve-case] [-I|--ignore-case] [--accelerator ACCELERATORS] [-t|--term-words LENGTH] [--nonstop-needed MIN] [--inputs-needed MIN] [--fullmsg-needed MIN] [--substr-needed MIN] [--locs-needed MIN] [--sort ORDER] [--source-language LANG] [-v|--invert] DESCRIPTION
See: http://translate.sourceforge.net/wiki/toolkit/poterminology for examples and usage instructions OPTIONS
--version show program's version number and exit -h/--help show this help message and exit --manpage output a manpage based on the help --progress show progress as: dots, none, bar, names, verbose --errorlevel show errorlevel as: none, message, exception, traceback -i/--input read from INPUT in pot, po formats -x/--exclude exclude names matching EXCLUDE from input paths -o/--output write to OUTPUT in po, pot formats -u/--update update terminology in UPDATEFILE -S/--stopword-list read stopword (term exclusion) list from STOPFILE (default /usr/share/pyshared/translate/share/stoplist-en) -F/--fold-titlecase fold "Title Case" to lowercase (default) -C/--preserve-case preserve all uppercase/lowercase -I/--ignore-case make all terms lowercase --accelerator ignores the given accelerator characters when matching -t/--term-words generate terms of up to LENGTH words (default 3) --nonstop-needed omit terms with less than MIN nonstop words (default 1) --inputs-needed omit terms appearing in less than MIN input files (default 2, or 1 if only one input file) --fullmsg-needed omit full message terms appearing in less than MIN different messages (default 1) --substr-needed omit substring-only terms appearing in less than MIN different messages (default 2) --locs-needed omit terms appearing in less than MIN different original source files (default 2) --sort output sort order(s): frequency, dictionary, length (default is all orders in the above priority) --source-language the source language code (default 'en') -v/--invert invert the source and target languages for terminology Translate Toolkit 1.9.0 poterminology(1)
All times are GMT -4. The time now is 05:08 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy