# 更换软件源:阿里、清华、中科大、东软均可
sudo nano /etc/apt/sources.list
# 官方源 | |
# deb http://http.kali.org/kali kali-rolling main non-free contrib | |
# deb-src http://http.kali.org/kali kali-rolling main non-free contrib | |
#根据需要自己选一个,中科大的还可以 | |
#中科大 | |
deb http://mirrors.ustc.edu.cn/kali kali-rolling main non-free contrib | |
deb-src http://mirrors.ustc.edu.cn/kali kali-rolling main non-free contrib | |
#阿里云 | |
#deb http://mirrors.aliyun.com/kali kali-rolling main non-free contrib | |
#deb-src http://mirrors.aliyun.com/kali kali-rolling main non-free contrib | |
#清华大学 | |
#deb http://mirrors.tuna.tsinghua.edu.cn/kali kali-rolling main contrib non-free | |
#deb-src https://mirrors.tuna.tsinghua.edu.cn/kali kali-rolling main contrib non-free |
# 安装 VNC 并设置自启动
sudo apt-get install tightvncserver
kali 已经安装了 tigervncserver
编辑配置文件:
sudo nano /etc/init.d/tightvncserver
#!/bin/sh | |
### BEGIN INIT INFO | |
# Provides: tightvncserver | |
# Required-Start: $local_fs | |
# Required-Stop: $local_fs | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Start/stop tightvncserver | |
### END INIT INFO | |
# More details see: | |
# http://www.penguintutor.com/linux/tightvnc | |
### Customize this entry | |
# Set the USER variable to the name of the user to start tightvncserver under | |
export USER='kali' | |
### End customization required | |
eval cd ~$USER | |
case "$1" in | |
start) | |
# 启动命令行。此处自定义分辨率、控制台号码或其它参数。 | |
su $USER -c '/usr/bin/tightvncserver -depth 16 -geometry 1280x720 :1' | |
echo "Starting TightVNC server for $USER " | |
;; | |
stop) | |
# 终止命令行。此处控制台号码与启动一致。 | |
su $USER -c '/usr/bin/tightvncserver -kill :1' | |
echo "Tightvncserver stopped" | |
;; | |
*) | |
echo "Usage: /etc/init.d/tightvncserver {start|stop}" | |
exit 1 | |
;; | |
esac | |
exit 0 |
修改文件权限,更新配置:
sudo chmod 755/etc/init.d/tightvncserver
sudo update-rc.d tightvncserver defaults
# 设置中文
sudo dpkg-reconfigure locales
如果发生错误?
然后编辑文件 /etc/default/locale 并将内容修改为:
# File generated by update-locale | |
LANGUAGE="zh_CN:zh" | |
LC_ALL="zh_CN.UTF-8" | |
LC_CTYPE="UTF-8" | |
LANG=zh_CN.UTF-8 |
VNC 如果连接后出现灰屏,可按一下方法解决:
修改文件~/.vnc/xstartup 为以下内容:
#!/bin/sh | |
unset SESSION_MANAGER | |
unset DBUS_SESSION_BUS_ADDRESS | |
startxfce4 & | |
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup | |
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources | |
xsetroot -solid grey | |
vncconfig -iconic & |
# kali 安装 1panel 面板
curl -sSL [https://resource.fit2cloud.com/1panel/package/quick_start.sh](https://resource.fit2cloud.com/1panel/package/quick_start.sh) -o quick_start.sh && bash quick_start.sh
安装 docker
apt-get install docker.io |
# 1panel 面板安装防火墙
# 更新软件包
# 安装 UFW
# 如果你在远程位置连接你的服务器,在启用 UFW 防火墙之前,你必须显式允许进来的 SSH 连接。否则,你将永远都无法连接到机器上。
# 放开 1Panel 系统端口。
# 启动 UFW
sudo ufw enable