Kali渗透 学习笔记(三)Kali本地网络配置
本地网络配置
临时配置IP地址
ifconfig eth0 192.168.1.53/24 #临时配置IP route add default gw 192.168.1.1 # 配置默认路由 echo nameserver 8.8.8.8 > /etc/resolv.conf #配置DNS服务器
永久配置IP地址
打开这个文件
vim /etc/network/interfaces
添加以下内容(根据自己的实际IP情况配置)
auto eth0 #eth0接口会在系统启动时被自动配置 iface eth0 inet static #配置eth0使用静态IP地址 address 192.168.126.53 #配置eth0的固定IP地址 netmask 255.255.255.0 #配置子网掩码 gateway 192.168.126.2 #配置网关
打开
vim /etc/resolv.conf
在文档最后插入DNS地址
nameserver 8.8.8.8
重启网络服务
systemctl restart networking
配置sshd服务并使用XShell链接
允许root用户登录sshd服务
vim /etc/ssh/sshd_config
修改 PermitRootLogin 和 PermitRootLogin
为
重启ssh服务
systemctl restart ssh
设置开机自启
update-rc.d ssh enable
使用XShell连接刚才设置的静态IP