# 1、登陆超级用户,并修改密码
sudo su - root
echo 'root:asd123.' | sudo chpasswd

# 2、配置 ssh 服务
sed -i 's/#PermitRootLogin .*/PermitRootLogin yes/' /etc/ssh/sshd_config
systemctl restart sshd
userdel `grep ":1000:" /etc/passwd | cut -d: -f1`

# 3、修改网卡
cat > /etc/network/interfaces.d/eth0 << EOF
auto eth0
iface eth0 inet static
address 10.0.0.7/24
gateway 10.0.0.254
dns-nameservers 223.5.5.5 223.6.6.6
EOF

# 4、配置dns 临时方案,在未安装 resolvconf 之前,安装后,直接改网卡配置文件里的 dns-nameservers 即可自动写入
cat > /etc/resolv.conf << EOF
nameserver 223.5.5.5
nameserver 223.6.6.6
EOF
systemctl restart networking

# 5、ping 百度
ping www.baidu.com

# 6、配置apt源
sed -i '/^deb\|^deb-src/ s/^/#/' /etc/apt/sources.list
cat > /etc/apt/sources.list.d/aliyun.list << EOF  
deb https://mirrors.aliyun.com/kali kali-rolling main non-free contrib
deb-src https://mirrors.aliyun.com/kali kali-rolling main non-free contrib
EOF
cat > /etc/apt/sources.list.d/tuna.list << EOF
deb https://mirrors.tuna.tsinghua.edu.cn/kali/ kali-rolling main non-free contrib
deb-src https://mirrors.tuna.tsinghua.edu.cn/kali/ kali-rolling main non-free contrib
EOF
cat > /etc/apt/sources.list.d/ustc.list << EOF 
deb https://mirrors.ustc.edu.cn/kali/ kali-rolling main non-free contrib
deb-src https://mirrors.ustc.edu.cn/kali/ kali-rolling main non-free contrib
EOF
apt clean all
apt update
apt upgrade

# 7 装就可以了,别问为啥
apt install -y resolvconf
apt install -y locales
apt install -y apt-transport-https ca-certificates
apt install -y docker.io docker-compose
systemctl enable resolvconf
systemctl start resolvconf
sed -i '/Description/a PartOf=docker.service' /lib/systemd/system/docker.socket
tee /etc/docker/daemon.json <<-'EOF'
{
  "registry-mirrors": ["https://9fbx5j9f.mirror.aliyuncs.com"],
  "live-restore": true
}
EOF
systemctl daemon-reload
systemctl start docker.service
systemctl enable docker


# 8、解决系统字符编码,kali2023不带字符编码 . . . 
# 8.1、选中en_US.UTF-8和zh_CN.UTF-8,确定后,将en_US.UTF-8选为默认。
dpkg-reconfigure locales
# 8.2、安装中文字体
apt-get install xfonts-intl-chinese 
apt-get install ttf-wqy-microhei
# 8.3、重启
reboot


# 9、代理设置
# 9.1、配置git代理【有魔法可配,没有直接略过】
git config --global http.proxy socks5://10.0.0.1:10810
git config --global https.proxy socks5://10.0.0.1:10810

# 9.2、配置pip代理
mkdir ~/.pip
cd ~/.pip && touch pip.conf
cat >> pip.conf << EOF
[global]
index-url = http://mirrors.aliyun.com/pypi/simple/
[install]
trusted-host = mirrors.aliyun.com
EOF

# 9.3、配置系统代理【有魔法可配,没有直接略过】
echo http_proxy=10.0.0.1:10811 >> /etc/profile
echo https_proxy=10.0.0.1:10811 >> /etc/profile
source /etc/profile
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.
  • 38.
  • 39.
  • 40.
  • 41.
  • 42.
  • 43.
  • 44.
  • 45.
  • 46.
  • 47.
  • 48.
  • 49.
  • 50.
  • 51.
  • 52.
  • 53.
  • 54.
  • 55.
  • 56.
  • 57.
  • 58.
  • 59.
  • 60.
  • 61.
  • 62.
  • 63.
  • 64.
  • 65.
  • 66.
  • 67.
  • 68.
  • 69.
  • 70.
  • 71.
  • 72.
  • 73.
  • 74.
  • 75.
  • 76.
  • 77.
  • 78.
  • 79.
  • 80.
  • 81.
  • 82.
  • 83.
  • 84.
  • 85.
  • 86.
  • 87.
  • 88.
  • 89.
  • 90.
  • 91.
  • 92.
  • 93.
  • 94.