Forcibly Logging a User Out

Problem

Someone is logged in to the router who shouldn't be and you need to log them out.

Solution

Forcibly log the user out:

	aviva@router1> request system logout user mike

 

Discussion

There are a number of situations when someone is logged in to the router who shouldn't be. A user may have walked away from the terminal or may be in configuration mode when you must change the configuration to deal with a problem situation.

Use the show system users command to list who is logged in to the router:

	aviva@router1> show system users
	 5:20AM up 81 days, 6:41, 1 user, load averages: 0.00, 0.00, 0.00
	USER TTY FROM LOGIN@ IDLE WHAT
	mike p0 172.10.28.108 5:20AM 4:07 -cli (cli)
	aviva p1 172.10.28.107 2:06AM - -cli (cli)

If another user is in configuration mode, you see his username in the message displayed when you enter configuration mode.

If you are logged in as root or have root privileges, you can forcibly log a user out of the router:

	aviva@router1> request system logout user mike

Mike would be logged out:

	mike@router1> Connection closed by foreign host.
	[server1.mycompany.com] mike@server%

You can send the user a message beforehand using a command similar to the Unix write utility:

	aviva@router1> request message user mike message "log out immediately"

You can send the message to a particular user, as we've done here, or to all logged-in users (similar to the Unix wall utility):

	aviva@router1> request message all message "log out immediately"

You can also specify the terminal (TTY) to forcibly log out a user:

	aviva@router1> request system logout terminal p0


Router Configuration and File Management

Basic Router Security and Access Control

IPSec

SNMP

Logging

NTP

Router Interfaces

IP Routing

Routing Policy and Firewall Filters

RIP

IS-IS

OSPF

BGP

MPLS

VPNs

IP Multicast



JUNOS Cookbook
Junos Cookbook (Cookbooks (OReilly))
ISBN: 0596100140
EAN: 2147483647
Year: 2007
Pages: 290
Authors: Aviva Garrett

Flylib.com © 2008-2020.
If you may any questions please contact us: flylib@qtcs.net