Article directory
In a few simple steps, use cpolar intranet penetration software to realize ssh remote connection to Kali!
1. Start the kali ssh service
By default, the newly installed kali system will close the ssh connection service, we open it through the command:
#启动ssh服务
sudo systemctl start ssh
#查看ssh 服务状态
sudo systemctl status ssh
#加入开机启动
sudo systemctl enable ssh
After starting, we check the ssh status, active means that ssh is running normally
Usually ssh uses an account or password to log in and connect, so it is also necessary to enable password authentication and edit the ssh configuration file:
sudo vim /etc/ssh/sshd_config
Uncomment the following two parameters and change the value to yes
After the modification is complete, save the file and restart the ssh service
sudo systemctl restart ssh
2. Kali installs cpolar intranet penetration
Kali is a Linux-based system. You can use the cpolar Linux installation method to quickly install it with one click. In the command interface of Kali, we enter the following commands. If you use it for the first time, you can register an account in the official website link below!
cpolar official website address: https://www.cpolar.com
- Install commands using one-click scripts
curl -L https://www.cpolar.com/static/downloads/install-release-cpolar.sh | sudo bash
- Add a service to the system
sudo systemctl enable cpolar
- Start the cpolar service
sudo systemctl start cpolar
After cpolar is installed and the service is successfully started, visit the port 9200 of Linux on the browser: [http://127.0.0.1:9200], log in with the account that has been canceled on the cpolar official website, and you can see the cpolar web configuration interface after logging in. Just configure it in the web interface
3. Configure kali ssh public network address
After logging in to the cpolar web UI management interface, click Tunnel Management on the left dashboard - Create Tunnel:
- Tunnel name: can be customized, be careful not to duplicate the existing tunnel name
- protocol: tcp
- Local address: 22
- Domain name type: temporary random TCP port
- Region: Select China VIP
click创建
Then open the online tunnel list on the left, and check the address of the ssh tcp connection generated after the tunnel was just created. This address is the public network connection address. We can use this address for ssh connection on any device
4. Remote connection
The public network address of ssh is created in kali above, and then we use the public network address on other devices to test the remote connection of ssh. Next, we connect on the command line of the windows system, and we can see that the connection is successful
Similarly, if we use the ssh connection tool, we can also connect normally, and enter the cpolar tcp public network address in the tool. Take Secure CRT as an example
We can see that the connection is successful, so we have a remote ssh address set up
5. Fixed connection SSH public network address
It should be noted that the above steps use a random temporary tcp port address, and the generated public network address is a random temporary address, which will change randomly within 24 hours. Next, we configure a fixed TCP port address for it, which will not change, and there is no need to modify the address repeatedly every day after setting.
To configure a fixed tcp port address, you need to upgrade cpolar to a professional package or above.
Reserve a fixed tcp address
Log in to the cpolar official website , click on the reservation on the left, find the reserved tcp address, let's reserve a fixed tcp address for Minecraft:
- Region: Select China VIP
- Description: It is a note, which can be customized
click保留
After the address is successfully reserved, the system will generate a corresponding fixed public network address and copy it down
Open the cpolar web ui management interface, click on the tunnel management on the left dashboard - tunnel list, find the TCP tunnel we created above, and click on the right编辑
Modify the tunnel information and configure the successfully reserved fixed tcp address into the tunnel
- Port type: modified to fixed tcp port
- Reserved tcp address: fill in the address successfully reserved on the official website,
click更新
After the tunnel is successfully updated, click the status on the left dashboard - the list of online tunnels, and you can see that the public network address has been updated to a fixed TCP address.
6. SSH fixed address connection test
After fixing the address, use our fixed TCP address to connect, you can see that the connection is successful, and a permanent fixed address is set
Reprinted from the cpolar pole cloud article: Kali installs Cpolar to realize Ssh remote connection