Results 1 to 10 of 10
  1. #1
    Join Date
    May 2009
    Location
    US
    Posts
    2,502

    Clear last login IP in ssh and "last" command

    Hello,
    How can I clear the last login IP address in SSH, when you login it'll say Last login from: xx.xxx.xxx.xx and etc..

    Also when you use the "last" command.

    How can you clear these?

    I am creating an OS template for my VPS nodes and thought it'd be better to clear these before proceeding to make them.

    I appreciate any help.

    Thank you!

  2. #2
    Join Date
    May 2009
    Location
    US
    Posts
    2,502
    Hello,
    Never mind, I figured it out.

    For anyone who wants to know how to do this, execute this command in root SSH: rm -rf /var/log/wtmp

    Thank you,
    ~ Adam

  3. #3
    thanks for this info

  4. #4
    Join Date
    May 2009
    Location
    US
    Posts
    2,502
    Quote Originally Posted by egmix View Post
    thanks for this info
    Glad to help.

  5. #5
    Join Date
    Apr 2004
    Location
    Germany
    Posts
    37
    /var/log/lastlog, too, if it exists.

    You may also want to get rid off /var/log/auth.log, and possibly off all the logs in general, if the intention is to remove any usage patterns. In the latter case, also look at /var/spool and /var/lib

  6. #6
    Join Date
    May 2009
    Posts
    31
    ya../var/log/lastlog may some time have the logs in it. Anyway thanks for the info mnaumann

  7. #7
    Join Date
    May 2009
    Location
    Kansas City
    Posts
    62
    You might want to consider this command instead of removing the entire file:

    > /var/log/wtmp

  8. #8
    Yeah I agree with team-vps. Blanking a file is always better than removing it completely:

    cat /dev/null > /var/log/wtmp

  9. #9
    Join Date
    Apr 2009
    Posts
    839
    /var/log/messages can also contain logs of success ssh sessions so it is good to review them too.

  10. #10
    Join Date
    Sep 2007
    Posts
    368

    *

    and also do

    # history -c [ clear your all commandshistory whatever you type otherwise person will get from history whatever you did]

    Thanks,
    Noman

Similar Threads

  1. How efficient are topic titles like "BLOWOUT", "SPECIAL" and "KILLER OFFER"?
    By BluewaveHosted in forum Running a Web Hosting Business
    Replies: 18
    Last Post: 06-30-2009, 11:21 AM
  2. How to show matching files in lower or UPPERcase with "ls" command?
    By mrzippy in forum Hosting Security and Technology
    Replies: 2
    Last Post: 03-27-2009, 03:50 PM
  3. Fraudulent "Provider" STAY CLEAR!!
    By TweakAdmin in forum Dedicated Server
    Replies: 43
    Last Post: 04-27-2007, 01:35 PM
  4. Shell "mkdir" and "wget"command help
    By galacnet in forum Programming Discussion
    Replies: 5
    Last Post: 01-21-2005, 03:05 PM
  5. "last login" in cpanel control panel always says "locla host"
    By kimrari in forum Hosting Software and Control Panels
    Replies: 3
    Last Post: 03-15-2004, 10:29 AM

Posting Permissions

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