# ubuntu huge syslog keep increasing (已找到原因) ## 使用`df -h`查看硬碟使用情形 - 發現1.8T的硬碟使用率已達100% ![](https://i.imgur.com/ziL7oyn.png) ## 上網google發現,是某些應用程式會產生大量的log檔 - [askubuntu/file-system-is-100-full](https://askubuntu.com/questions/405060/file-system-is-100-full) - cd 到 `//var/log`查看log情形 ``` cd //var/log ``` - list all directory of file in current directory with the size ``` du -sh * ``` - list the 10 biggest files of current directory ``` ls -l --sort=size | head -10 ``` - `syslog.*`佔最大宗 ![](https://i.imgur.com/eMaQrQ3.png) ## Remove the huge log files - [stackoverflow/ubuntu-large-syslog-and-kern-log-files](https://stackoverflow.com/questions/35638219/ubuntu-large-syslog-and-kern-log-files) - Remove All logs files from /var/log which are of large size ### 進入`root`模式 ``` sudo su ``` ### TRUNCATE THE FILE, DO NOT DELETE - do `>` ``` > /var/log/syslog ``` - don't `rm` ~~rm -rf syslog*~~ ## Empty the trash ``` rm -rf ~/.local/share/Trash/* ``` ## 2020/4/14 重要更新 - [reference](https://ubuntuforums.org/showthread.php?t=2160292) ### 解法: 關閉遠端桌面 **Settings -> Sharing -> Screen Sharing -> Off** ### 原因: 不明人士嘗試想遠端桌面(資安問題) - use `tail` to check syslog ``` tail -f /var/log/syslog ``` ![](https://i.imgur.com/PKzxXGl.png) - 上網google了syslog上記錄的這些想連進來的ip,有來自俄羅斯,德國 - 照上面解法步驟即可解決 ###### tags: `ubuntu 18.04`