{"id":3885,"date":"2025-04-26T13:08:24","date_gmt":"2025-04-26T12:08:24","guid":{"rendered":"https:\/\/raspberry-projects.com\/pi\/?p=3885"},"modified":"2025-04-26T13:25:32","modified_gmt":"2025-04-26T12:25:32","slug":"security-admin-tips","status":"publish","type":"post","link":"https:\/\/raspberry-projects.com\/pi\/pi-operating-systems\/ubuntu-servers\/security-admin-tips","title":{"rendered":"Security admin tips"},"content":{"rendered":"\n<p>A few important bits to look at as an Ubuntu server sysadmin<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Some useful sysadmin commands<\/h4>\n\n\n\n<h5 class=\"wp-block-heading\">Display all current connections, listening services, and processes<\/h5>\n\n\n\n<p>Really useful Ubuntu sysadmin utility:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>netstat -tulpn<\/code><\/pre>\n\n\n\n<p>If its not present, use this to install it: sudo apt install net-tools<\/p>\n\n\n\n<p>To only see the runnign services, use:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>service --status-all | grep \"&#91; + ]\"<\/code><\/pre>\n\n\n\n<h5 class=\"wp-block-heading\">Check for Rootkits<\/h5>\n\n\n\n<p>The &#8220;rkhunter&#8221; package is useful for doing a scan of your system for any known rootkits:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>apt-get install rkhunter\nrkhunter -C<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Configuration file locations<\/h4>\n\n\n<p>Apache 2:<\/p>\n<p style=\"padding-left: 40px;\">\/etc\/apache\/apache2.conf<\/p>\n<p>SSH Server<\/p>\n<p style=\"padding-left: 40px;\">\/etc\/ssh\/sshd_config<\/p>\n<p>MySQL<\/p>\n<p style=\"padding-left: 40px;\">\/etc\/mysql\/mysql.cnf<\/p>\n\n\n<h4 class=\"wp-block-heading\">Log files<\/h4>\n\n\n\n<h5 class=\"wp-block-heading\">View log files<\/h5>\n\n\n\n<p>Good for scrolling through log files:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>less \/path\/to\/log\/file<\/code><\/pre>\n\n\n\n<p>Type &#8216;q&#8217; to quit<\/p>\n\n\n\n<p>Good for viewing the end of a log file and seeing new messages as they get added:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>tail \/path\/to\/log\/file<\/code><\/pre>\n\n\n\n<h5 class=\"wp-block-heading\">Log file locations<\/h5>\n\n\n<p>Whole system logs and current activity logs:<\/p>\n<p style=\"padding-left: 40px;\">\/var\/log\/message<\/p>\n<p>Authentication logs<\/p>\n<p style=\"padding-left: 40px;\">\/var\/log\/auth.log<\/p>\n<p>Kernel logs<\/p>\n<p style=\"padding-left: 40px;\">\/var\/log\/kern.log<\/p>\n<p>Cron logs<\/p>\n<p style=\"padding-left: 40px;\">\/var\/log\/cron.log<\/p>\n<p>Mail server logs<\/p>\n<p style=\"padding-left: 40px;\">\/var\/log\/maillog<\/p>\n<p>System boot log<\/p>\n<p style=\"padding-left: 40px;\">\/var\/log\/boot.log<\/p>\n<p>MySQL database server log file<\/p>\n<p style=\"padding-left: 40px;\">\/var\/log\/mysqld.log<\/p>\n<p>Authentication log<\/p>\n<p style=\"padding-left: 40px;\">\/var\/log\/secure<\/p>\n<p>Login records file<\/p>\n<p style=\"padding-left: 40px;\">\/var\/log\/utmp or \/var\/log\/wtmp<\/p>\n<p>Apt package manager logs<\/p>\n<p style=\"padding-left: 40px;\">\/var\/log\/apt<\/p>","protected":false},"excerpt":{"rendered":"<p>A few important bits to look at as an Ubuntu server sysadmin Some useful sysadmin commands Display all current connections, listening services, and processes Really useful Ubuntu sysadmin utility: If its not present, use this to install it: sudo apt install net-tools To only see the runnign services, use: Check for Rootkits The &#8220;rkhunter&#8221; package [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[200],"tags":[],"class_list":["post-3885","post","type-post","status-publish","format-standard","hentry","category-ubuntu-servers"],"_links":{"self":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts\/3885","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/comments?post=3885"}],"version-history":[{"count":5,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts\/3885\/revisions"}],"predecessor-version":[{"id":3892,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts\/3885\/revisions\/3892"}],"wp:attachment":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/media?parent=3885"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/categories?post=3885"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/tags?post=3885"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}