kali的配置文件和rhel還是有些不同,之前也沒怎麼玩過kali,一上手就遇到兩個問題,如何配置靜態IP,無法使用root用戶遠程連接。
靜態IP配置
root@kali:/etc# cat /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
iface lo inet loopback
auto eth0
iface eth0 inet static
#iface eth0 inet dhcp
address 192.168.110.10
netmask 255.255.255.0
gateway 192.168.110.1
重啓網絡服務
root@kali:/etc# /etc/init.d/networking restart
DNS設置
root@kali:/etc# cat /etc/resolv.conf
# Generated by NetworkManager
nameserver 114.114.114.114
ssh遠程root用戶登錄
默認情況kali只允許普通用戶遠程登錄
需要修改ssh服務的配置項
root@kali:/etc# vim /etc/ssh/sshd_config
#PermitRootLogin prohibit-password
PermitRootLogin yes
# Change to no to disable tunnelled clear text passwords
PasswordAuthentication yes
重啓sshd服務
root@kali:~# /etc/init.d/ssh restart
這裏遇到一個奇葩的問題,當我把ssh服務停掉後,已有的ssh遠程連接依舊保持連接狀態。