kali Linux connection Xshell

Table of contents

Step one: Change root password

Step 2: Check the IP address

 Step 3: Set up a static IP

Step 4: Restart the network card

Step 5: Enable ssh

 Step 5: Connect in Xshell


kali Linux version: kali Linux 2023.1

VMware virtual machine version: VMware16.0.0

Xshell version: Xshell 7

First download its image file from the official websiteKali Linux | Penetration Testing and Ethical Hacking Linux Distribution.

Step one: Change root password

sudo passwd root

Enter in kali terminal: sudo passwd root

You will be prompted to enter the password for kali (usually the password for the image file downloaded from the official website is kali )

Then enter your new password twice

su root

Enter the su root command to log in to the root user

After entering the command, enter the password you just defined.

 

Step 2: Check the IP address

ifconfig

Use ifconfig to check IP address

 Remember the IP address here will be used later

 Step 3: Set up a static IP

vim /etc/network/interfaces

 Use the vim command to open the /etc/network/interfaces file

 Click on the file and then press i to enteredit mode

add below

auto eth0
inface eth0 inet static
address 192.168.*.*
gateway 192.168.*.2
netmask 255.255.255.0

Fill in the IP address you just viewed in address

Fill in the gateway and fill in the IP address just now, but the difference is that the last digit is replaced by 2.

 

Press Esc to exit editing mode,entercommand mode

 Enter :wq to save

Step 4: Restart the network card

ifconfig eth0 down
ifconfig eth0 up

Restart the network card through the above two commands

Step 5: Enable ssh

 vim /etc/ssh/sshd_config

Also enter the etc/ssh/sshd_config file through the vim command

Click on the file and press i to enteredit mode

Find #PermitRootLogin prohibit-password

Change to PermitRootLogin yes

 

 

Press Esc to exit editing mode,entercommand mode

 Enter :wq to save

Then start ssh through the following two codes

service ssh start #启用ssh
systemctl enable --now ssh #开机启动

 Step 5: Connect in Xshell

Create a new one in Xshell (alt+n)

Enter the IP address of the static IP you just set on the host, and the name can be anything you want.

 In user authentication

Username is root

The password is the root password defined at the beginning

 

 

 Finally, just click Connect

Guess you like

Origin blog.csdn.net/m0_69655483/article/details/130675106