How to Examine a Remote Linux Server via SSH: A Sysadmin's Guide.
As a system administrator, one of the key skills you need is the ability to examine and troubleshoot a remote Linux server via SSH. Whether you're dealing with a new server or stepping into an unfamiliar environment, this brief guide serves as a starting point outlining essential steps to gather information, troubleshoot issues, and ensure the smooth operation of the system.
Connect via SSH
ssh command to connect to the remote server. Replace
username with your actual username and
hostname with the server's IP address or host name.
If the SSH port is different from the default (port 22), specify the port using the
ssh -p PORT username@hostname
You may be prompted for a password or key passphrase. Enter the correct credentials to authenticate.
Gather Basic Information
Use basic Linux commands to gather information about the system. Some useful commands include:
uname -a: Displays information about the system.
lsb_release -a: Shows Linux distribution details.
hostnamectl: Provides information about the system and its configuration.
Explore the Filesystem
Navigate through the filesystem to understand its structure:
cd /: Change to the root directory.
ls -l: List the contents of the current directory with detailed information.
pwd: Display the present working directory.
Check System Logs
Examine system logs for any errors or issues. Common log files of interest include:
/var/log/syslog: logs everything, except authentication related messages.
/var/log/messages: logs non-debug and non-critical messages on older systems.
In more recent versions, that use the
systemd init system, you can use the
journalctl to examine log files. To show all log entries in reverse chronological order, execute
Identify the Package Manager & Install Basic Tools
Common package managers include
apt (Debian/Ubuntu), or
dnf (Fedora/Red Hat). Newer versions of Ubuntu also use the
snap packaging system. If you want to install additional tools for examining the system, update the package manager's repository information and then install the respective package. Using
apt as an example:
sudo apt update
sudo apt install <package>
Check Network Configuration
Examine the network configuration using commands like
ip a and check network-related files in
Perform basic security checks by looking at the running services:
and reviewing firewall settings, which are often managed by
User and Group Information
Use commands like
less /etc/group, and
getent passwd to gather information about users and groups.
Check System Resources
Verify system resource usage with commands like
Investigate Running Processes
ps aux to view all running processes and identify any suspicious ones.
Check Disk Usage
Analyze disk usage with
df -h to identify space distribution on different partitions.
Review Configuration Files
Examine important configuration files in
/etc/ related to services, network, and system settings. For example to view the contents of the SSH daemon configuration file, use
Learning to use SSH and the tools mentioned is crucial for any system administrator working with remote Linux servers. The basic steps for examining and troubleshooting these machines enable you to gather valuable information, check important configurations and investigate running processes.
Remember, the specifics might vary based on the Linux distribution running on the remote computer. Therefore, understanding your distribution's package manager and file locations is beneficial. This also applies to specific applications, such as email and web servers. Always prioritize security and adhere to best practices during your examination.
To continue exploring and enhancing your Linux system administrator skills, check out the man pages of the commands and the resources below.
- Python's Global Interpreter Lock (GIL): Understanding the Pros and Cons
- Profitable Freelance Writing: Top Niches & Success Advice
- Unlocking the Potential of Podcasting as a Profitable Online Venture
Subscribe to RSS Feed
This post was written by Ramiro Gómez (@yaph) and published on . Subscribe to the Geeksta RSS feed to be informed about new posts.
Tags: howto linux sysadmin
Disclosure: External links on this website may contain affiliate IDs, which means that I earn a commission if you make a purchase using these links. This allows me to offer hopefully valuable content for free while keeping this website sustainable. For more information, please see the disclosure section on the about page.
Share post: Facebook LinkedIn Reddit Twitter