Ignore certain hosts in last log

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












I have an ansible job that uses ssh to perform tasks on many servers. It uses an authorized key to gain entry. When I run the last command it just shows a long list of root logins from the ansible host.



root@myserver:/# last
root pts/1 ansiblehost.mydomain Tue Jan 2 7:00 - 7:00 (00:00)
root pts/1 ansiblehost.mydomain Tue Jan 2 8:00 - 8:00 (00:00)
root pts/1 ansiblehost.mydomain Tue Jan 2 9:00 - 9:00 (00:00)
root pts/1 ansiblehost.mydomain Tue Jan 2 10:00 - 10:00 (00:00)
root pts/1 ansiblehost.mydomain Tue Jan 2 11:00 - 11:00 (00:00)


I would like to suppress these entries from occurring because it fills up the screen and prevents me from investigating who has been logging in to the server.



Alternately, I would accept a way to set up my own logging of authentication for certain groups. For instance, if a user, who is in the admin group, logs in (ssh or terminal) it will make an entry in a log file /var/log/logins.log.







share|improve this question


























    up vote
    0
    down vote

    favorite












    I have an ansible job that uses ssh to perform tasks on many servers. It uses an authorized key to gain entry. When I run the last command it just shows a long list of root logins from the ansible host.



    root@myserver:/# last
    root pts/1 ansiblehost.mydomain Tue Jan 2 7:00 - 7:00 (00:00)
    root pts/1 ansiblehost.mydomain Tue Jan 2 8:00 - 8:00 (00:00)
    root pts/1 ansiblehost.mydomain Tue Jan 2 9:00 - 9:00 (00:00)
    root pts/1 ansiblehost.mydomain Tue Jan 2 10:00 - 10:00 (00:00)
    root pts/1 ansiblehost.mydomain Tue Jan 2 11:00 - 11:00 (00:00)


    I would like to suppress these entries from occurring because it fills up the screen and prevents me from investigating who has been logging in to the server.



    Alternately, I would accept a way to set up my own logging of authentication for certain groups. For instance, if a user, who is in the admin group, logs in (ssh or terminal) it will make an entry in a log file /var/log/logins.log.







    share|improve this question
























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I have an ansible job that uses ssh to perform tasks on many servers. It uses an authorized key to gain entry. When I run the last command it just shows a long list of root logins from the ansible host.



      root@myserver:/# last
      root pts/1 ansiblehost.mydomain Tue Jan 2 7:00 - 7:00 (00:00)
      root pts/1 ansiblehost.mydomain Tue Jan 2 8:00 - 8:00 (00:00)
      root pts/1 ansiblehost.mydomain Tue Jan 2 9:00 - 9:00 (00:00)
      root pts/1 ansiblehost.mydomain Tue Jan 2 10:00 - 10:00 (00:00)
      root pts/1 ansiblehost.mydomain Tue Jan 2 11:00 - 11:00 (00:00)


      I would like to suppress these entries from occurring because it fills up the screen and prevents me from investigating who has been logging in to the server.



      Alternately, I would accept a way to set up my own logging of authentication for certain groups. For instance, if a user, who is in the admin group, logs in (ssh or terminal) it will make an entry in a log file /var/log/logins.log.







      share|improve this question














      I have an ansible job that uses ssh to perform tasks on many servers. It uses an authorized key to gain entry. When I run the last command it just shows a long list of root logins from the ansible host.



      root@myserver:/# last
      root pts/1 ansiblehost.mydomain Tue Jan 2 7:00 - 7:00 (00:00)
      root pts/1 ansiblehost.mydomain Tue Jan 2 8:00 - 8:00 (00:00)
      root pts/1 ansiblehost.mydomain Tue Jan 2 9:00 - 9:00 (00:00)
      root pts/1 ansiblehost.mydomain Tue Jan 2 10:00 - 10:00 (00:00)
      root pts/1 ansiblehost.mydomain Tue Jan 2 11:00 - 11:00 (00:00)


      I would like to suppress these entries from occurring because it fills up the screen and prevents me from investigating who has been logging in to the server.



      Alternately, I would accept a way to set up my own logging of authentication for certain groups. For instance, if a user, who is in the admin group, logs in (ssh or terminal) it will make an entry in a log file /var/log/logins.log.









      share|improve this question













      share|improve this question




      share|improve this question








      edited Jan 31 at 19:31









      aliceinpalth

      760116




      760116










      asked Jan 31 at 16:49









      paxamus

      443




      443

























          active

          oldest

          votes











          Your Answer







          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "106"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );








           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f421014%2fignore-certain-hosts-in-last-log%23new-answer', 'question_page');

          );

          Post as a guest



































          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes










           

          draft saved


          draft discarded


























           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f421014%2fignore-certain-hosts-in-last-log%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

          How to check contact read email or not when send email to Individual?

          Bahrain

          Postfix configuration issue with fips on centos 7; mailgun relay