Every VPS that has just turned on the internet will have its SSH password detected by a bot in just a few minutes. SSHWATCH is a free open source tool that I asked Claude to write: this tool will turn port 22 into a trap. trap (honeypot SSH), records accounts, passwords and commands that hackers type, then displays them all Realtime attack map. This article provides step-by-step instructions so that even beginners can install it in about 10 minutes.
📢 Join the channel Telegram belong to AnonyViet
Update new articles, cool tools and IT tips fastest
Quick summary
- What is SSHWATCH: realtime attack monitoring dashboard + SSH honeypot + permanent repository, running on Ubuntu/Debian VPS.
- Install with 1 command:
curl -fsSL https://raw.githubusercontent.com/anonyvietofficial/sshwatch/main/installer/dist/sshwatch-setup.sh | sudo bash - Real SSH is transferred to the port
52022safely (there is a step to try to log in first, errors are automatically recovered). - Gate 22 becomes a trap: the bot logs into a fake shell, No commands are actually executed.
- Free, open source (MIT license). See demo: ssh.anonyviet.com.
What is SSHWATCH?

SSHWATCH is an attack monitoring toolkit for Linux servers, consisting of 3 parts:
- SSH honeypot (sshpot): a fake SSH server located on ports 22 and 2222. It responds identically to the VPS’s real OpenSSH, allowing the bot to “successfully log in” to a fake shell, then recording every account, password, command, and malicious link the bot uses. Fake shells do not run any commands on real machine.
- Dashboard realtime: The website displays a world map with direct attack routes, top IPs, countries, network operators (ASN), most detected passwords, used hacker tools, shell session logs… Data is pushed to the browser as soon as an event occurs.
- Explorer (repository): list complete, not abridged any IP, user/pass pair, command, malicious URL, web attack type… Permanently saved, searchable, sorted and CSV exportable.
In addition to SSH, SSHWATCH also reads logs for recording web attack (detect WordPress, scan files .envexploiting vulnerabilities), Detect email/FTP password and port scanning (port scan). You can watch AnonyViet’s running version live at ssh.anonyviet.com.
What is a honeypot? Why should you use it?
Honeypot is a fake system set up to attract attackersto observe what they do without harming the real system. With VPS, the benefits are very specific:
- Real increase in security: Real SSH leaves the default port 22, so most automated password sniffing bots will just hit the trap.
- Know who is attacking you: IP, country, carrier, time, frequency.
- Know which passwords are being detected: If your password is on this list, change it immediately.
- Collect malicious code samples: see the link to download the botnet and miner that the hacker tried to install after “getting in”.
- Early alarm: Send Telegram alerts and self-report bad IPs to AbuseIPDB (optional).
What do I need to prepare before installing?
| Request | Detail |
|---|---|
| VPS | Ubuntu 20.04, 22.04, 24.04, 26.04 or Debian 11, 12, 13. x86_64 or ARM64 CPU. 512 MB RAM or more is enough. |
| Rights | Account root or user has sudo. |
| Your computer | Windows 10/11 (using PowerShell with built-in commands ssh), macOS or Linux (using Terminal). |
| Domain name (optional) | Only if you want to make your dashboard public with HTTPS for everyone to see. |
Not supported: Ubuntu 18.04, Debian 10, CentOS/AlmaLinux/Rocky, and OpenVZ/LXC container VPS are not available systemd.
Note: Should be installed on a VPS that you have access to web console (VNC) of the provider, to prevent the worst case scenario of being locked out of SSH.
Instructions for installing SSHWATCH step by step

Step 1: Open port 52022 on the provider’s firewall
(This step only applies to providers with external Firewalls such as AWS, Oracle…), if not, go to step 2.
Once installed, your real SSH will switch to the port 52022. Firewall inside VPS (ufw, firewalld, iptables) is installed open automatically. But many suppliers still have them external firewall that the installer cannot reach, for example AWS (Security Group), Google Cloud, Oracle Cloud, Azure, Hetzner, Vultr, Contabo.
Go to your provider’s admin page and add an authorization rule TCP port 52022 from anywhere (or just from your IP). If your VPS does not have an external firewall, skip this step.
Step 2: Log in to VPS
Can be used Mobaxterm to SSH and VPS or On Windows, open PowerShell (click Start, type “PowerShell”). On macOS/Linux, open Terminal. Type the following command instead IP_VPS with your server IP:
ssh root@IP_VPS
First time connecting, typing yes to accept the server key, then enter the password (when typing the password, no characters will appear, which is normal).
Step 3: Run the installation command
Paste the following command line into the terminal and press Enter. Change letters TenCuaBan to the name you want to display on the dashboard:
curl -fsSL https://raw.githubusercontent.com/anonyvietofficial/sshwatch/main/installer/dist/sshwatch-setup.sh | sudo bash -s -- --brand "TenCuaBan"
If you want to see the file content before running (recommended for all scripts downloaded from the internet), use 2 commands:
curl -fsSLO https://raw.githubusercontent.com/anonyvietofficial/sshwatch/main/installer/dist/sshwatch-setup.sh sudo bash sshwatch-setup.sh --brand "TenCuaBan"
The installer will do everything itself:
- Wait if the new VPS is updating itself (apt is busy), then install the necessary packages.
- If your operating system’s Python is too old (Ubuntu 20.04, Debian 11), create your own Python environment.
- Download GeoIP location data (DB-IP Lite) and schedule weekly updates.
- Run dashboard at
127.0.0.1:8787and honeypot at the gate2222. - Prepare to switch real SSH to port 52022 (see step 4).
Installation time is usually from 1 to 5 minutes depending on the network speed of the VPS.
Step 4: Try logging in to the new Port, then type “yes”
Here is the step most important. Now real SSH is listening both Port 22 and 52022and the installer will stop asking you. Do not close open terminal windows. Open another PowerShell/Terminal window new and try:
ssh -p 52022 root@IP_VPS
- If you can log in: Go back to the old window, type
yesthen Enter. Real SSH leaves port 22, honeypot receives port 22. From now on you always access VPS usingssh -p 52022 root@IP_VPS. - If you can’t log in: type anything else
yes(or Enter). Port 22 is still real SSH, you do not lose access. Check step 1 again, then continue with the following port switching step with the command:
sudo bash /opt/sshwatch/install.sh --finish-ssh-move
If the port switching step encounters an error midway, the installer automatically restore the SSH configuration to the sameso you don’t get locked out.
Step 5: Open dashboard to view attacks
For security reasons, the dashboard only listens on 127.0.0.1 (inside VPS), should type http://IP_VPS:8787 from outside will can’t get in. This is intentional. The fastest way to view, without needing a domain name, is to use SSH tunnel. On your computer run:
ssh -p 52022 -L 8787:127.0.0.1:8787 root@IP_VPS
Keep this window open, then open the browser and enter http://localhost:8787. You will see the attack map, and after just a few minutes to a few hours, the first bots will appear.
Page Explorer live http://localhost:8787/explore allows viewing of all data: select data type (IP, country, user/pass combo, command, malicious URL…), search, click on an IP to see its full profile, and export CSV.
Access the dashboard using your own Domain
If you want, everyone can see the dashboard like ssh.anonyviet.complease order one reverse proxy front. The easiest way for newbies is Caddybecause it gets its own HTTPS certificate for free.
1. Point domain name to VPS: In the DNS management page, create a record Aname example watchvalue is VPS IP. Wait a few minutes for DNS to update.
2. Install Caddy (according to Caddy’s official instructions for Debian/Ubuntu):
sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https curl curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list sudo apt update sudo apt install -y caddy
3. Caddy configuration: Open the configuration file with sudo nano /etc/caddy/Caddyfiledelete the old content and paste it (replace watch.tenmiencuaban.com with your domain name):
watch.tenmiencuaban.com {
reverse_proxy 127.0.0.1:8787 {
flush_interval -1
header_up X-Forwarded-For {remote_host}
}
}
Save the file (Ctrl+O, Enter, Ctrl+X) then run sudo systemctl reload caddy.
4. Open ports 80 and 443 at the provider’s firewall and in the VPS. If VPS uses ufw: sudo ufw allow 80,443/tcp.
Then enter https://watch.tenmiencuaban.com that’s it. If the VPS already has nginx or CyberPanel/OpenLiteSpeed, use the sample configuration files available in the directory /opt/sshwatch/examples/.
Tip: want to hide the attacker’s IP when made public (display a.x.c.d), fix MASK_IPS=1 in the configuration file (see below).
Advanced configuration: Telegram, AbuseIPDB warnings
All configurations are in the file /etc/sshwatch/sshwatch.env. Open with sudo nano /etc/sshwatch/sshwatch.envfix and run sudo systemctl restart sshwatch.
Receive alerts via Telegram (when the bot enters a fake shell, when there is a new malicious link, when an IP attacks heavily):
- Chat with @BotFather on Telegram, type
/newbotname and copy token. - Send any message to the newly created bot.
- Open
https://api.telegram.org/botin your browser, find/getUpdates "chat":{"id": ...}and copy the id number. - Fill in the configuration file:
TELEGRAM_BOT_TOKEN=andTELEGRAM_CHAT_ID=.
Self-report bad IP to AbuseIPDB: Create a free account at abuseipdb.com, get your API key and fill it in ABUSEIPDB_KEY=. Each IP is reported a maximum of once every 15 minutes, and the password is never sent.
Other options in the file: BRAND (display name), ADMIN_IPS (Your IP, never recorded), WEB_LOGS (web log path to follow).
Commonly used management commands
| Things to do | Command |
|---|---|
| View status | sudo bash /opt/sshwatch/install.sh --status |
| Upgrade to new version (keep data intact) | Rerun the installation command in step 3 |
| Restart the dashboard | sudo systemctl restart sshwatch |
| View dashboard error log | journalctl -u sshwatch -n 50 |
| View honeypot error log | journalctl -u sshpot -n 50 |
| Uninstall (return port 22 to real SSH) | sudo bash /opt/sshwatch/install.sh --uninstall |
| Delete both database and log | sudo bash /opt/sshwatch/install.sh --uninstall --purge |
Some options when installing:
| Optional | Meaning |
|---|---|
--ssh-port N |
Change real SSH port (default 52022) |
--honeypot-ports "22 2222" |
Trap gates |
--admin-ip IP |
Your IP is never recorded (default is the IP being SSHed in) |
--brand "Tên" |
Name displayed on dashboard |
--no-scan |
Turn off port scan recording |
--fail2ban-port |
Point fail2ban to the new SSH port |
--yes |
Install without asking (don’t take port 22, unless added --take-port-22) |
Handling common errors
| Phenomena | How to handle |
|---|---|
| Unable to log in to port 52022 | Open TCP 52022 at the provider’s firewall (step 1). If you haven’t typed yet yesport 22 can still be used normally. |
| Accidentally locked out | Go to your provider’s web console (VNC), run: rm /etc/ssh/sshd_config.d/05-sshwatch-port.conf && systemctl restart ssh |
Enter IP_VPS:8787 impossible |
Normally, the dashboard only listens internally. Use SSH tunnel (step 5) or domain name + Caddy. |
apt is still busy after 10 minutes |
VPS is installing a major update. Wait for it to finish and then run the installation command again. |
pip could not download asyncssh |
VPS cannot connect to pypi.org. Check the outgoing DNS or firewall, then run again. |
systemd is not running here |
Container VPS (OpenVZ/LXC), not supported. |
| The map does not show the location | GeoIP data is loading in the background. The position will be compensated for old events when loading is complete. |
Frequently Asked Questions (FAQ)
Does installing an SSH honeypot make a VPS less secure?
Are not. Fake shell of SSHWATCH do not execute any commandsjust return fake results and log them. The honeypot runs as a separate user without root privileges, limited to the systemd sandbox. On the contrary, moving real SSH away from port 22 greatly reduces the number of times bots detect passwords to real SSH.
Is SSHWATCH free?
Have. SSHWATCH is open source software under the MIT license, source code publicly available at github.com/anonyvietofficial/sshwatch. GeoIP data uses the free DB-IP Lite version.
How often do we see hacker attacks?
Usually just a few minutes to a few hours after installation. Port 22 of every public IP is constantly scanned by botnets, so a normal VPS can record hundreds to thousands of password guesses every day.
Is changing SSH port enough to secure VPS?
Not enough. Changing the port only reduces automated bots. You should still use it Log in with SSH keyturn off password login, set a strong root password, and update the operating system regularly. SSHWATCH helps you see attacks to understand the risks.
Can SSHWATCH be used with fail2ban, CyberPanel, nginx?
Okay. SSHWATCH reads fail2ban logs to display blocked IPs, reads web logs of CyberPanel/OpenLiteSpeed, nginx, Apache. More options --fail2ban-port If you want fail2ban to protect the new SSH port.
Can it be installed on multiple VPS?
Have. Each VPS runs the same installation command, each machine has its own dashboard. Use --brand to give different names to each machine.
How long is data saved?
Permanently, in a SQLite database on your own VPS (/opt/sshwatch/sshwatch.db). No data is sent out unless you enable Telegram or AbuseIPDB yourself.
Conclude
With just one command, SSHWATCH just helped your VPS more secure (Real SSH leaves port 22), just for you see with your own eyes How hackers around the world are sniffing passwords and trying to install malicious code on servers. Try watching the demo here ssh.anonyviet.comthen install it on your VPS. If you find it useful, don’t forget to visit GitHub Give the project a star and report a bug if you encounter problems.






