Output the entire process of a request communication
Â
systemctl
The systemctl command is used for to init system and service manager.
Starting and Stopping Services
Start/Stop a Service immediately.
Enabling and Disabling Services
Enable/Dsiable a Service to start on boot.
Checking Service Status
Check Status: Check the status of a service.
Managing the Systemd System
Reload Systemd: Reload the systemd manager configuration.
Reboot the System: Use systemctl to reboot the system.
Listing Services
List Active Services: List all active services.
Â
Other Useful Commands
Mask/Unmask a Service: Prevent a service from being started manually or automatically (mask) or reverse this action (unmask).
netcat
Basic Data Transfer
Server Side (Receiving Data):
Client Side (Sending Data):
Setting Up a Simple Chat Server
Server Side:
This command sets Netcat to listen on port 1234 for incoming connections.
Client Side:
Connecting to the server's IP address (replace server_address) on port 1234 starts the chat session.
Â
Create command alias
SSH
Build ssh connect by using the specific key
Local Port Forwarding
Visit 8080 port on local machine will looks like visit the web server
Â
Local Port Forwarding with a Bastion Host
Â
Remote Port Forwarding
Â
Remote Port Forwarding from a Home/Private Network
Add environment variables on MAC
Search texts
dig
DNS lookup utility.
NC
A networking tool used for reading from and writing to network connections using TCP or UDP protocols. It's often described as the "Swiss army knife" of networking due to its wide range of capabilities. Here are some common uses and examples of the nc command:
Common Uses
Creating a TCP Connection:
Connect to a server: nc [server] [port]
For example, to connect to a web server on port 80: nc example.com 80
Listening for Incoming Connections:
Listen on a specific port: nc -l [port]
For example, to listen on port 1234: nc -l 1234
Transferring Files:
On the receiving end: nc -l [port] > filename.ext
On the sending end: nc [destination] [port] < filename.ext
Chat Server and Client:
Server: nc -l [port]
Client: nc [server address] [port]
Port Scanning:
Scan a range of ports: nc -z [destination] [port-range]
For example, to scan ports 20-30: nc -z example.com 20-30
Testing Network Throughput:
On the server: nc -l [port] > /dev/null
On the client: nc [server address] [port] < /dev/zero