In this article, we’ll explain 9 things to do in the new Linux server..
Its recommended that, check the server before putting it to work. There are various types of commands available to verify the server details. We’ll discuss those commands in this article.
1. First contact
When you first login into your server, check for the operating system, kernel, hardware architecture, uptime of the server. You can use following commands to get this information. For this demonstration purpose, we’re using CentOS.
# cat /etc/redhat-release
# uname -a
2. Check if any one logged in
Next, check if any other user logged in to your server. Use the following command to list the users who logged in.
3. Physical or virtual machine
Let’s identify whether it’s a physical machine or a virtual machine (VM).
Use the following commands to identify this information. If it’s a physical system, you will see the vendor’s name (e.g., HP, IBM, etc.) and the make and model of the server; whereas, in a virtual machine, you should see KVM, VirtualBox, etc., depending on what virtualization software was used to create the VM:
# dmidecode -s system-manufacturer
# dmidecode -s system-product-name
# lshw -c system | grep product | head -1
Use the following commands to display the hardware connected to a Linux server. Some of the commands might be deprecated in newer operating system versions, but you can still install them from yum repos or switch to their equivalent new commands:
# ethtool <network interface name>
5. Installed software
Use the following commands to identify what software is installed:
# rpm -qa
# rpm -qa | grep <pkgname>
# rpm -qi <pkgname>
# yum repolist
# yum repoinfo
# yum install <pkgname>
# ls -l /etc/yum.repos.d/
6. Running processes and services
Use the following commands to identify running processes and enabled services in the server:
# ps -ef
# ps auxf
7. Network connections
Use the following commands to identify network services-related information.
# iptables -L -n
# cat /etc/resolv.conf
Use the following commands to identify tunable kernel parameters, kernel version, and which kernel modules are loaded:
# uname -r
# cat /proc/cmdline
# modinfo <module>
# sysctl -a
# cat /boot/grub2/grub.cfg
Use the following commands to see your system’s logs:
# tail -f /var/log/messages
In this article, we have seen 9 things to do in the new Linux server.