• Image Management Service

ims
  1. Help Center
  2. Image Management Service
  3. User Guide
  4. Managing Private Images
  5. Optimizing a Linux Private Image
  6. Clearing System Logs

Clearing System Logs

Clear system logs and historical records, and stop the ECS.

  1. Run the following commands to delete redundant key files:

    echo > /$path/$to/$root/.ssh/authorized_keys

    An example command is echo > /root/.ssh/authorized_keys.

    echo > /$path/$to/$none-root/.ssh/authorized_keys

    An example command is echo > /home/linux/.ssh/authorized_keys.

  1. Run the following command to clear log files in the /var/log directory:

    rm -rf /var/log/*

  2. Run the following commands to clear historical records:

    history -w

    echo > /root/.bash_history

    history -c

    history -c

    history -c