PortScan › Port guide › Port 6379

Port 6379 (Redis): How Unauthenticated Redis Leads to Server Takeover

TCP 6379RedisDatabaseExposure risk: High

Port 6379 is Redis. Unauthenticated Redis on the internet falls to CONFIG SET attacks that plant SSH keys or miners. protected-mode, bind and requirepass.

What is port 6379?

Redis is an in-memory key-value store widely used for caching, sessions and queues. Port 6379 is its default.

Redis was originally designed on the assumption that it would "only run on a trusted internal network", and for a long time its default configuration had no authentication. Since version 3.2, protected-mode rejects external connections when no password is set, but it is still common to turn that protection off or open Redis with bind 0.0.0.0.

When it is normally open

Risks if it is open

Writing files with CONFIG SET

An attacker who connects without authentication changes where the database is saved with CONFIG SET dir /root/.ssh and CONFIG SET dbfilename authorized_keys, stores their own public key as a value, runs SAVE, and logs in over SSH. The same trick is used to plant jobs in cron directories.

Mining botnets

Automated campaigns that find open Redis instances and plant miners this way have been running for years.

Data exposure

Session tokens and cached personal data can be read as-is.

Security checklist

How to check whether port 6379 is open

From outside (is it exposed to the internet?)

Whether your server or home router accepts port 6379 from the internet can only be confirmed by connecting from outside. A check from inside the same network bypasses the router's firewall and gives a different answer.

PortScan opens a real TCP connection from the Cloudflare edge and reports Open, Closed or Filtered. Members can scan every port on their own IP for free and other targets free once a day.

Check port 6379

On the server (what is listening?)

Windows (PowerShell):

netstat -ano | findstr ":6379 "
Get-NetTCPConnection -LocalPort 6379 -State Listen | Select LocalAddress,OwningProcess

Linux:

sudo ss -tlnp | grep ':6379 '

If it listens on 0.0.0.0 or [::] it is open on every network; 127.0.0.1 means only that machine can connect. To test port 6379 on a server from another computer, use Test-NetConnection server-address -Port 6379 on Windows or nc -vz server-address 6379 on Linux and macOS.

How to close or restrict port 6379

The best fix is to turn the service off or make it listen only on 127.0.0.1 (see the checklist above). If you need the service but must keep it off the internet, use a firewall.

Windows Firewall

# Administrator PowerShell
New-NetFirewallRule -DisplayName "Block TCP 6379" -Direction Inbound -Protocol TCP -LocalPort 6379 -Action Block
# To allow a single IP instead (block rules take precedence, so use this instead of the rule above)
New-NetFirewallRule -DisplayName "Allow TCP 6379 from office" -Direction Inbound -Protocol TCP -LocalPort 6379 -RemoteAddress 203.0.113.10 -Action Allow

Linux (ufw)

sudo ufw deny 6379/tcp
# Allow a single IP only
sudo ufw allow from 203.0.113.10 to any port 6379 proto tcp

On a cloud server, also check port 6379 in the security group (inbound rules), which is separate from the OS firewall. For services running in Docker, the rules Docker creates can bypass ufw, so binding the port to localhost with -p 127.0.0.1:6379:6379 is the reliable option.

Router

At home or in a small office, open the router's admin page and check whether port 6379 is in the port forwarding list, whether DMZ is enabled, and whether any program opened ports by itself through UPnP. If any of the three applies, port 6379 on your PC is directly visible from the internet.

How to read the scan result

The verdict can depend on where you connect from. Many ISPs (including most Korean ISPs) block some ports such as 135, 139 and 445 on their network, so the same server can look Filtered from inside that network and Closed from abroad.

FAQ

Is it okay to run Redis as root?
No. The attack above can write to root's SSH key directory only because Redis was running as root. Run it under a dedicated account.
11211 Memcached27017 MongoDB6380 Redis (alternate)

Last updated 2026-11-04 · Use this guide to check systems you manage. Scanning systems without permission may carry legal liability.