Linux Commands and Scripts

9 Things to do in The New Linux Server

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
# hostnamectl
# uptime

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.

# last

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

4. Hardware

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:

# lscpu

# lsmem

# ethtool <network interface name>

# lshw

# dmidecode

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
# systemctl

7. Network connections

Use the following commands to identify network services-related information.

# ss
# iptables -L -n
# cat /etc/resolv.conf

6. Kernel

Use the following commands to identify tunable kernel parameters, kernel version, and which kernel modules are loaded:

# uname -r
# cat /proc/cmdline
# lsmod
# modinfo <module>
# sysctl -a
# cat /boot/grub2/grub.cfg

9.Logs

Use the following commands to see your system’s logs:

# dmesg
# tail -f /var/log/messages
# journalctl

Thats it.

In this article, we have seen 9 things to do in the new Linux server.

Get a high performance dual E5 series dedicated server and cheap KVM VPS.

Related Articles