https://github.com/isaka-james/closeport
A Linux Tool that forcefully turn off PORTS on your PC.
https://github.com/isaka-james/closeport
close-port closing-ports forcefully linux ports server-administration
Last synced: 7 months ago
JSON representation
A Linux Tool that forcefully turn off PORTS on your PC.
- Host: GitHub
- URL: https://github.com/isaka-james/closeport
- Owner: isaka-james
- License: mit
- Created: 2024-07-19T01:18:51.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-09-04T10:15:09.000Z (about 1 year ago)
- Last Synced: 2025-01-26T16:47:23.895Z (9 months ago)
- Topics: close-port, closing-ports, forcefully, linux, ports, server-administration
- Language: Shell
- Homepage:
- Size: 9.77 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Close Port Tool
![]()
A simple Bash script to identify processes using a specified port, retrieve their process IDs (PIDs), and terminate them. This script requires superuser (sudo) permissions to run.
## Overview
The `closeport.sh` script is designed to help system administrators and users easily manage network ports by terminating any processes that are currently using a specified port.
## Features
- Takes a port number as an argument.
- Identifies if any processes are using the specified port.
- Retrieves the process IDs (PIDs) of these processes.
- Terminates the processes using the specified port.
- Provides feedback on whether any processes were found and terminated or if the port was unused.## Requirements
- Bash shell
- `sudo` privileges## Usage
1. **Clone the Repository**
```bash
git clone https://github.com/isaka-james/closeport.git
```2. **Navigate to the Repository**
```bash
cd closeport
```3. **Make the Script Executable**
```bash
chmod +x closeport.sh
```4. **Run the Script**
```bash
sudo ./closeport.sh
```Replace `` with the port number you want to check and close. For example:
```bash
sudo ./closeport.sh 8080
```## Example
If the script is run with port `8080` and there is a process using this port, you might see output like:
```
Process with PID 1234 is using port 8080 and has been terminated.
```If no process is found using the specified port:
```
No process is using port 8080.
```## Nerd Installation
```bash
sudo chmod +x closeport.sh && sudo mv closeport closeport && sudo mv closeport /usr/bin && echo "Installed successfully!"
```
So now you can type `sudo closeport 8080` to forcefully stop PORT 8080 in your MACHINE.If you ever feel to uninstall it then type `sudo rm -rf /usr/bin/closeport`
## License
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
## Author
Isaka James