kicking a telneted user from the system


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers kicking a telneted user from the system
# 1  
Old 10-27-2002
kicking a telneted user from the system

hi there,

does anyone know how to kick a telneted user from a the system?

thx
# 2  
Old 10-27-2002
as root do a ps aux from the command prompt
and then look for the shell proccess id and then kill it. also you can kill the telnet session.
# 3  
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..
# 4  
Old 11-01-2002
thx
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

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. 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

7. 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

8. 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

9. 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
Login or Register to Ask a Question