JUNOS: Force users to logout

I hate it when I login to the router and try to make some changes and it router tells me other people are logged in. Sure I can run a show | compare to see any uncommitted changes but you know what, I want my own space ;-)

So before you make any changes you can either run the 'configure exclusive' command to ensure the router is all yours or else kill everyone off!

First things first, here is what the config looks like when everyone is doing stuff.

root@EX1> configure
Entering configuration mode
Users currently editing the configuration:
root terminal p0 (pid 1770) on since 2011-09-08 12:23:08 UTC, idle 14w4d 02:38
root terminal p0 (pid 3029) on since 2011-09-08 14:23:54 UTC, idle 2w5d 21:57
root terminal u0 (pid 35800) on since 2011-09-13 16:11:19 UTC, idle 13w5d 22:3
root terminal u0 (pid 48572) on since 2011-09-15 11:35:58 UTC, idle 13w4d 02:4
root terminal u0 (pid 92771) on since 2011-09-15 14:40:27 UTC, idle 13w3d 23:0
root terminal u0 (pid 99225) on since 2011-10-06 12:14:29 UTC, idle 10w4d 02:2
{master:0}[edit routing-instances]

Not Good.

So lets kills everyone - luckily JUNOS is clever enough to realise we don't need to be killed off along with all other root users. Clearly if you are smart you'll have a list of usernames and if you do simply replace all with the ones you want to kill off. In my case I'm not too smart and everyone logs into my EX as root (well it's just me - we're pretending right?).

Issue the request system logout command

root@EX1> request system logout all user root

error: logout-user: need to qualify root with terminal


root@EX1> configure
Entering configuration mode

See - no-one around!!!

Have fun

© 2011 defaultrouteuk.com

Cisco, IOS, CCNA, CCNP, CCIE are trademarks of Cisco Systems Inc.
JunOS, JNCIA, JNCIP, JNCIE are registered trademark of Juniper Networks Inc.