28.06.2014 Views

Discussion

Discussion

Discussion

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Mar 16 11:00:54 router1 login: LOGIN_PAM_AUTHENTICATION_ERROR: PAM auhentication<br />

error for user pwd<br />

Mar 16 11:00:54 router1 login: LOGIN_FAILED: Login failed for user pwd from host<br />

Mar 16 11:00:55 router1 login: LOGIN_INFORMATION: User root logged in from host<br />

[unknown] on device ttyd0<br />

Mar 16 21:57:59 router1 login: LOGIN_INFORMATION: User aviva logged in from host<br />

172.17.28.108 on device ttyp0<br />

Mar 16 21:58:04 router1 mgd[4102]: UI_DBASE_LOGIN_EVENT: User 'aviva' entering<br />

configuration mode<br />

You can create multiple system logging files to track messages from different sources<br />

and of different severities. Instead of sifting through the messages file to find out what<br />

users and processes have been logging in to the router, you can configure a system<br />

logging file for only those activities.<br />

[edit system syslog]<br />

aviva@router1# set file security authorization info<br />

The following are examples of some of the logging messages that are saved as a result<br />

of this configuration:<br />

aviva@router1> show log security<br />

Mar 18 01:53:41 router1 init: ntp (PID 4194) exit on SIGHUP, will be restarted to<br />

get the new config<br />

Mar 18 01:53:41 router1 init: ntp (PID 4644) started<br />

Mar 18 01:54:16 router1 login: LOGIN_INFORMATION: User aviva logged in from host<br />

172.17.28.108 on device ttyp0<br />

Mar 18 01:55:41 router1 init: ntp (PID 4644) exit on SIGHUP, will be restarted to<br />

get the new config<br />

Mar 18 01:55:41 router1 init: ntp (PID 5006) started<br />

By default, only the root user and users with the JUNOS maintenance permission can<br />

read the contents of logfiles (see Recipe 2.10). If a number of people need to be able<br />

to read a system logfile, you should change the permission on the file. This is similar<br />

to the Unix chmod utility.<br />

[edit system syslog]<br />

aviva@router1# set file messages archive world-readable<br />

aviva@router1# set file security archive world-readable<br />

To verify that the file permissions have changed, use the file list detail command.<br />

The files are still owned by root, but they are readable by anyone.<br />

aviva@router1> file list detail /var/log<br />

-rw-rw-r-- 1 root wheel 5883 Mar 18 02:00 messages<br />

-rw-rw-r-- 1 root wheel 17638 Mar 18 02:01 security<br />

See Also<br />

Recipe 2.10<br />

166 | Chapter 5: Logging<br />

This is the Title of the Book, eMatter Edition<br />

Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!