文章目录
- 观前提示:本环境在 root 用户下
- kali 配置静态网络地址
- 打开网络配置文件
 
- kali 配置 ssh 远程连接
 
观前提示:本环境在 root 用户下
kali 配置静态网络地址
打开网络配置文件
vim /etc/network/interfaces
出现一下内容
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).source /etc/network/interfaces.d/*# The loopback network interface
auto lo							# 这一行指示系统在启动时自动激活 lo 接口
iface lo inet loopback			# 这定义了 lo 接口使用 IPv4 的回环地址,通常是 127.0.0.1。这是系统内部通信使用的虚拟网络接口,不与外部网络交互。# The primary network interface
allow-hotplug eth0				# 这一行表示 eth0 接口支持热插拔,即系统会在检测到接口时自动配置它。
iface eth0 inet dhcp			# 指定 eth0 使用动态 IP 地址配置修改后内容
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).source /etc/network/interfaces.d/*# The loopback network interface
auto lo
iface lo inet loopback# The primary network interface
allow-hotplug eth0
iface eth0 inet static		# 启动静态ip
address 192.168.100.10		# 设置静态ip
netmask 255.255.255.0		# 设置子网掩码
gateway 192.168.100.2		# 指定网关
添加 DNS
打开 DNS 文件
vim /etc/resolv.conf 
添加以下内容
nameserver 8.8.8.8
重启网络
systemctl restart networking
检查配置是否成功
ip a
出现配置 IP 即为成功(IP 的具体范围需要根据自身环境搭配)
kali 配置 ssh 远程连接
打开 ssh 配置文件
vim /etc/ssh/sshd_config
- 将 # PermitRootLogin prohibit-password修改为PermitRootLogin yes
- 将 # PubkeyAuthentication yes修改为PubkeyAuthentication yes
重启 ssh 服务
service ssh restart