0% found this document useful (0 votes)
15 views

Linux system and network administration

About linux

Uploaded by

Abrham Lemu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views

Linux system and network administration

About linux

Uploaded by

Abrham Lemu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 84

Linux system and network

administration

By Kibreab A.
Linux GUI
joe
Joe schmo
Userdel -r
Lisa Simpson
groupadd

Make bob groupmember of projectX


Adding other user
Group member of ProjectX have read (r) and write permissions
Uptime Command

In Linux uptime command shows since how long your


system is running and the number of users are currently
logged in and also displays load average for 1,5 and 15
minutes intervals.
W Command

It will displays users currently logged in and their process


along-with shows load averages.
It also shows the login name, tty name, remote host,
login time, idle time and processes.
Who Command

who command simply return user name, date, time


and host information. who command is similar to w
command.
Unlike w command, who doesn’t print what users are
doing. Lets illustrate and see the different between
who and w commands.
Who command Options
• -b : Displays last system reboot date and time.
• -r : Shows current runlet.
• -a, –all : Displays all information in cumulatively.
Whoami Command

whoami command print the name of current user.


You can also use “who am i” command to display
the current user.
If you are logged in as a root using sudo command
“whoami” command return root as current user.

Use “who am i” command if you want to know the


exact user logged in.
CP Command
MV Command
Cd command (change directory)
pwd command (print working directory)
SSH Command (Secure Shell)
SSH command is used to login into remote host. For
example the below ssh command will connect to remote
host (192.168.50.2) using user as narad.
pwd command (print working directory)
Ftp or sftp Command

ftp or sftp command is used to connect to remote


ftp host.
ftp is (file transfer protocol) and sftp is (secure
file transfer protocol). For example the below
commands will connect to ftp host
(192.168.50.2).
Free command
last command

With last command we can watch user’s activity in


the system.
This command can execute normal user also.
It will display complete user’s info like terminal,
time, date, system reboot or boot and kernel
version. Useful command to troubleshoot.
You can use last with username to know for
specific user’s activity as shown below.
ps command
kill command

Use kill command to terminate process. First find


process id with ps command as shown below and
kill process with kill -9 command.
rm command
Commands for Linux Network configuration

1) ifconfig
ifconfig (interface configurator) command is use to initialize
an interface, assign IP Address to interface and enable or
disable interface on demand. With this command you can
view IP Address and Hardware / MAC address assign to
interface and also MTU (Maximum transmission unit) size.

ifconfig with interface (eth0) command only shows specific


interface details like IP Address, MAC Address etc. with -a
options will display all available interface details if it is
disable also.
Ifconfig cont’d…
Ifconfig eth0
# ifconfig eth0 down //to disable interface eth0
# ifconfig eth0 up //to enable interface eth0
# ifconfig eth0 add 192.168.1.101 //to assign ip
address to interface eth0
# ifconfig eth0 netmask 255.255.255.0 //to assign
subnet mask to interface eth0
# ifconfig eth0 // to display information configured
with eth0
To assign Ip address and subnet mask
PING Command
PING (Packet INternet Groper) command is the best way to
test connectivity between two nodes. Whether it is Local
Area Network (LAN) or Wide Area Network (WAN).

No basic network administration is effective without the


ping command.
I use it for testing server configuration and checking status.
The ping command basically sends test packets to a
specific server and checks if there is a response.

Ping use ICMP (Internet Control Message Protocol) to


communicate to other devices. You can ping host name of
ip address using below command.
Ping cont’d…
TRACEROUTE Command

traceroute is a network troubleshooting utility


which shows number of hops taken to reach
destination also determine packets traveling path.

Below we are tracing route to global DNS server IP


Address and able to reach destination also shows
path of that packet is traveling.
traceroute
NETSTAT Command

Netstat (Network Statistic) command display connection info, routing table


information etc. To displays routing table information use option as -r.

netstat (network statistics) is a command line tool for monitoring network


connections both incoming and outgoing as well as viewing routing
tables, interface statistics etc.
netstat is available on all Unix-like Operating Systems and also available on
Windows OS as well.
It is very useful in terms of network troubleshooting and performance
measurement.

netstat is one of the most basic network service debugging tools, telling
you what ports are open and whether any programs are listening on
ports.
Netstat –r information about routing table
Linux command for Displaying service name with
their PID (process ID )number, using option
netstat -tp will display “PID/Program Name”.
NSLOOKUP Command
nslookup is a command-line administrative tool for testing and
troubleshooting DNS servers (Domain Name Server).
It is used to query specific DNS resource records (RR) as well.
Most operating systems comes with built-in nslookup feature.

We can also use DIG Command instead of nslookup


Dig (domain information groper) query DNS related information
like A Record, CNAME, MX Record etc. This command mainly
use to troubleshoot DNS related query.
Dig tecmint.com or nslookup tecmint.com

The following examples shows A Record (IP Address) of


tecmint.com.
Route command

route command also shows and manipulate ip


routing table. To see default routing table in
Linux, type the following command. It is
Equivalent to netsat –r.
Adding, deleting routes and default Gateway with
following commands.
HOST Command
host command to find name to IP or IP to name in
IPv4 or IPv6 and also query DNS records.
ARP (Address Resolution Protocol) Command

ARP (Address Resolution Protocol) is useful to


view / add the contents of the kernel’s ARP
tables. To see default table use the command as.
HOSTNAME Command
hostname is to identify in a network. Execute
hostname command to see the hostname of
your box.
GUI tool system-config-network

Type system-config-network in command prompt to


configure network setting and you will get nice
Graphical User Interface (GUI) which may also use to
configure IP Address, Gateway, DNS etc. as shown
below image
Tcpdump – Network Packet Analyzer

Tcpdump one of the most widely used command-


line network packet analyzer or packets sniffer
program that is used capture or filter TCP/IP
packets that received or transferred on a specific
interface over a network.
It also provides a option to save captured packages
in a file for later analysis.
tcpdump is almost available in all major Linux
distributions.
Tcpdump –i eth0
Command line tools for Linux Monitoring
1) Top – Linux Process Monitoring
Linux Top command is a performance monitoring program which
is used frequently by many system administrators to monitor
Linux performance and it is available under many Linux/Unix
like operating systems.
The top command used to display all the running and active real-
time processes in ordered list and updates it regularly. It display
CPU usage, Memory usage, Swap Memory, Cache Size, Buffer
Size, Process PID, User, Commands and much more.
It also shows high memory and cpu utilization of a running
processes.
The top command is much useful for system administrator to
monitor and take correct action when required. Let’s see top
command in action.
2) Htop – Linux Process Monitoring

Htop is a much advanced interactive and real time


Linux process monitoring tool.
This is much similar to Linux top command but it
has some rich features like user friendly interface
to manage process, shortcut keys, vertical and
horizontal view of the processes and much more.

Htop is a third party tool and doesn’t included in


Linux systems, you need to install it using YUM
package manager tool.
3) iotop – Monitor Linux Disk I/O
iotop is also much similar to top command and
Htop program, but it has accounting function to
monitor and display real time Disk I/O and
processes.
This tool is much useful for finding the exact
process and high used disk read/writes of the
processes.
Note: Install iotop monitoring tools, if not
available.
4) VmStat – Virtual Memory Statistics
Linux VmStat command used to display statistics of virtual
memory, kernerl threads, disks, system processes, I/O
blocks, interrupts, CPU activity and much more.
By default vmstat command is not available under Linux
systems you need to install a package called sysstat that
includes a vmstat program. The common usage of
command format is.
IPTraf – Real Time IP LAN Monitoring
IPTraf is an open source console-based real time
network (IP LAN) monitoring utility for Linux.
It collects a variety of information such as IP traffic
monitor that passes over the network, including TCP
flag information, ICMP details, TCP/UDP traffic
breakdowns, TCP connection packet and byte
counts.

It also gathers information of general and detailed


interface statistics of TCP, UDP, IP, ICMP, non-IP, IP
checksum errors, interface activity etc.
iptraf
6)Psacct or Acct – Monitor User Activity

psacct or acct tools are very useful for monitoring each


users activity on the system.
Both daemons runs in the background and keeps a
close watch on the overall activity of each user on
the system and also what resources are being
consumed by them.

These tools are very useful for system administrators


to track each users activity like what they are doing,
what commands they issued, how much resources
are used by them, how long they are active on the
system etc.
7)Monit – Linux Process and Services Monitoring
• Monit is a free open source and web based
process supervision utility that automatically
monitors and managers system processes,
programs, files, directories, permissions,
checksums and filesystems.
• It monitors services like Apache, MySQL, Mail,
FTP, ProFTP, Nginx, SSH and so on.
• The system status can be viewed from the
command line or using it own web interface.
8) NetHogs – Monitor Per Process Network
Bandwidth
NetHogs is an open source nice small program
(similar to Linux top command) that keeps a tab
on each process network activity on your system.

It also keeps a track of real time network traffic


bandwidth used by each program or application.
9) Monitorix – System and Network Monitoring
Monitorix is a free lightweight utility that is designed to run
and monitor system and network resources as many as
possible in Linux/Unix servers.
It has a built in HTTP web server that regularly collects
system and network information and display them in
graphs.
It Monitors system load average and usage, memory
allocation, disk driver health, system services, network
ports, mail statistics (Sendmail, Postfix, Dovecot, etc),
MySQL statistics and many more.
It designed to monitor overall system performance and helps
in detecting failures, bottlenecks, abnormal activities etc.
Thank you!! I wish you all the best!!!

You might also like