Setting Up Persistent SSH Access to Kali Linux Using TCP Tunneling

Enabling SSH Service on Kali Linux

New Kali installations have SSH disabled by default. Enable it with the following commands:

# Start the SSH daemon
sudo systemctl start ssh

# Verify SSH is running
sudo systemctl status ssh

# Enable SSH on boot
sudo systemctl enable ssh

Once SSH is active, you need to configure password authentication. Open the SSH daemon configuration:

sudo vim /etc/ssh/sshd_config

Uncomment and set these parameters to yes:

PasswordAuthentication yes
PermitRootLogin yes

Apply the changes by restarting the service:

sudo systemctl restart ssh

Installing cpolar Tunneling Client

Kali is Debian-based and supports cpolar's Linux installation script. Run the following in your terminal:

curl -L https://www.cpolar.com/static/downloads/install-release-cpolar.sh | sudo bash

Configure cpolar to start automatically:

sudo systemctl enable cpolar
sudo systemctl start cpolar

After installation, access the cpolar dashboard at http://127.0.0.1:9200 and sign in with your registered account.

Creating a Public TCP Tunnel

In the cpolar web interface, navigate to Tunnel ManagementCreate Tunnel and configure:

  • Tunnel Name: Any unique identifier
  • Protocol: TCP
  • Local Address: 22
  • Port Type: Random TCP port
  • Region: China VIP

Click Create. View the generated TCP endpoint in Online Tunnel List—this public address enables remote connections from any device.

Establishing Remote SSH Connection

Use the generated TCP address from any external machine. From Windows CMD:

ssh user@<public-tcp-address>

Alternatively, connect via tools like SecureCRT or PuTTY by entering the TCP endpoint.

Configuring a Static TCP Endpoint

The randomly asigned TCP port changes every 24 hours. To maintain a consistent address, upgrade to cpolar Professional or higher.

In the cpolar dashboard, go to Reserved Addresses and create a new reservation:

  • Region: China VIP
  • Description: Custom label

Copy the reserved static address after confirmation.

Return to Tunnel ManagementTunnel List, find your TCP tunnel, and click Edit:

  • Port Type: Fixed TCP port
  • Reserved TCP Address: Paste your static address

Click Update. The tunnel now uses a permanent endpoint visible in Online Tunnel List.

Testing the Permanent Connection

Connect using the fixed TCP adress:

ssh user@<fixed-tcp-address>

The connection succeeds, providing a stable remote access point that never changes.

Tags: ssh Kali Linux cpolar TCP Tunnel Remote Access

Posted on Mon, 20 Jul 2026 16:15:40 +0000 by Jack Sparrow