Results 1 to 4 of 4

Thread: +r to /var/log/auth.log ? is this safe ?

  1. #1
    Join Date
    Dec 2010
    Location
    Earth
    Beans
    142
    Distro
    Ubuntu 10.10 Maverick Meerkat

    +r to /var/log/auth.log ? is this safe ?

    Is it safe to add +r permission to the auth.log.1 and auth.log

    -rw-r--r-- /var/log/auth.log
    -rw-r--r-- /var/log/auth.log.1

    why i needed to ~ on apache2 web (password protected area) - I made a simple perl.cgi to read successful and failed ssh login attempts.

    of courses the "www-data" users returned a error 500 thru apache2 with out adding the +r to the auth.log
    is this ok.

    The basic script is here for reference. (not good at perl first script ever)
    Code:
    #!/usr/bin/perl
    #
    # Will display a html report of all successful and failed ssh logins
    # by: highspider
    
    #VARS
    $SUCCESS='Accepted password for';
    $FAILED='Failed password for';
    my @files= qw| /var/log/auth.log /var/log/auth.log.1  |;
    my @ary;
    
    #LOOP AND GET THE FILE'S DATA INTO AN ARRAY
    for my $filename(@files){
        open INF, $filename ||
            die "Cannot open $filename for reading: $!\n";
        push @ary, <INF>;
        close INF;
    }
    
    #HTML HEADER
    print "Content-type:text/html\n\n";
    print "<html>\n";
    print "<head><title>SSH LOGS</title></head>\n";
    print "<body>\n";
    
    #SUCCESSFUL TABLES
    print "<h1>Succesful SSH logins</h1>\n";
    print "<table border=\"1\">\n";
    foreach $line (@ary) {
     if ($line =~ m/$SUCCESS/) {
       print "<tr><td>$line<tr><td>\n";
     }
    }
    print "</table>\n";
    
    #FAILED TABLES
    print "<h1>Failed SSH logins</h1>\n";
    print "<table border=\"1\">\n";
    foreach $line (@ary) {
     if ($line =~ m/$FAILED/) {
       print "<tr><td>$line<tr><td>\n";
      }
    }
    print "</table>\n";
    
    #HTML FOOTER
    print "</body>\n";
    print "</html>\n";
    Last edited by highspider; April 12th, 2011 at 12:29 AM. Reason: auth.log.1 and auth.log (cleaned code)
    In a perfect world my college professors would allow assignment as .odt openoffice.org files! And code as Eclipse projects.

  2. #2
    Join Date
    Dec 2010
    Location
    Earth
    Beans
    142
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: +r to /var/log/auth.log ? is this safe ?

    BUMP

    Is it safe to add +r permission to the auth.log.1 and auth.log


    (Ubuntu default)_______________________ (my new permissions)
    -rw-r----- /var/log/auth.log_______.______-rw-r--r-- /var/log/auth.log
    -rw-r----- /var/log/auth.log.1____________-rw-r--r-- /var/log/auth.log.1
    In a perfect world my college professors would allow assignment as .odt openoffice.org files! And code as Eclipse projects.

  3. #3
    Join Date
    Oct 2006
    Beans
    35

    Re: +r to /var/log/auth.log ? is this safe ?

    probably not, add yourself to the "adm" group instead as this group already has read access to /var/log/auth.log

  4. #4
    Join Date
    May 2010
    Location
    Tewkesbury uk
    Beans
    7,801
    Distro
    Ubuntu Development Release

    Re: +r to /var/log/auth.log ? is this safe ?

    Old thread. Closed.
    If you believe everything you read, you better not read. ~ Japanese Proverb

    If you don't read the newspaper, you're uninformed. If you read the newspaper, you're mis-informed. - Mark Twain

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •