Kali Linux System Management

In our this article we are going to learn how we can handle our Linux box. This is the basics for system admins and penetration testers. Here we will learn about starting/stopping system service, installing stuffs on Linux and much more. We are covering things as a penetration testers perspective on our Kali Linux system. But this same things can be done on any Debian based Linux distribution, like Ubuntu, Linux Mint, Elementary OS etc.

kali linux system management

These things we are going to learn will lead our whole Linux (specially Debian-based) journey not only Kali Linux.

Linux Host Information

To know our hostname on Linux, we just need to execute the hostname command on our terminal window. As we can see in the following screenshot:

hostname on linux

Hostname is the name of our computer. If we want to change it we can edit it's configuration file by sudo nano etc/hostname command. Then we put their our required name for the computer. Then we need to save it then reboot too see the effects.

Linux OS Information

Knowing the information of an Operating System or OS is very essential for privilege escalation. So that the penetration tester can gain information if the version used is vulnerable. To know the information of the OS we need to run uname -a command.

uname operating system information
In the above screenshot we had used -a flag to know all the information. If we need any specific information about then we can use different flags like kernel name (-s), network node hostname (-n), kernel release (-r), kernel version (-v), machine hardware name (-m), processor type (-p), hardware platform (-i), name of operating system (-o).

Linux Hardware Information

On Linux system, if we want to know about our system's hardware information then we need to know these commands.

To check our CPU information we need to check our /proc/cpuinfo by using following command:

cat /proc/cpuinfo
cpu information on linux

Almost same way if we wanna check our RAM information then we need to run cat /proc/meminfo command. We can see the output on the following screenshot.

ram information on Linux

To see attached devices with our system (like hard disk, disk partitions etc), then we need to use sudo fdisk -l (here -l flag displays partitions) command. This also show us external drives connected with our system.

fdisk to display partitions

To display the list of USB devices like mouse, keyboard, thumb drive, wifi adapter, rtl-sdr etc we need to use lsusb command. As we can see in the following screenshot.

usb devices attached list

To see all the mounted directories into the file system, then we need to execute mount command.

mounted directories

Managing Services on Linux

Services are servers that can run on our Linux or Kali Linux system, such as SSH Apache, FTP etc.

To manage  services on Linux we need to use commands like following

  • sudo service servicename status to check the status of the service.
  • sudo service servicename start to start a service.
  • sudo service servicename stop to stop a service.
  • sudo service servicename restart to restart a service.

We also can use sudo systemctl servicename status/start/stop/restart to do the same thing.

Package Management

For doing package management first we need to update our Kali Linux system's repository. We have an entire article on Kali Linux repository. In short Kali Linux repository is located on /etc/apt/sources.list, we can open it by using following command:

sudo nano /etc/apt/sources.list

After putting sudo password we can see the default repository in the following screenshot:

kali linux repository
We can update our system or download new tools directly from repository. to update our system (like Windows update), we need to run following command:
sudo apt update -y

To upgrade the system we need to run following command:

sudo apt upgrade -y

We have an previous article on updating Kali Linux system.

Installing Packages on Linux

There are various ways to installing packages or software on Linux system. Commonly there are two ways:

  • Installing from software packages.
  • Installing from repository.

When we are installing a software package, we need to download the package with .deb extension from the internet then we need to run sudo dpkg -i filename.deb command to install the package.

To download packages from repository we need to run command like sudo apt install packagename command.

To remove software package from our system we need to run sudo apt remove packagename command.

To find a package name on repository we need to run command apt-cache search packagename.

Finally, if we need to install a package and we're not sure if the package is exists on the repository or not we need to run command apt-cache show packagename.

Process Management on Linux

One of our most favorite process management tool on Kali Linux is htop. But it is not come pre-installed on Kali Linux. We need to install it from repository by using following command:

sudo apt install htop
installing htop on kali linux

After installing it we need to run htop command and we can see all the  running process on our terminal window, as we can see in the following screenshot:

htop showing running process
While taking screenshot, we got the highlighted process

Another way to get the list of currently running process is by using the ps -A u command, as we can see in the following screenshot.

processing on Linux

We can see the PID (Process Identification Number) on both screenshot we can this are the numbers of the processing. We can stop any processing services by running kill PID_NUMBER command. If the system refuse to kill it we can do it forcefully by applying kill -9 PID_NUMBER command.

This is about how we can manage process and manage our Linux system. Love our articles? Make sure to follow us on Twitter and GitHub, we post article updates there. To join our KaliLinuxIn family, join our Telegram Group. We are trying to build a community for Linux and Cybersecurity. For anything we always happy to help everyone on the comment section. As we know our comment section is always open to everyone. We read each and every comment and we always reply.

AIX

Posting Komentar

Lebih baru Lebih lama