在树莓派4b上安装kali linux 2019.4并启用vnc服务

安装 x11vnc 工具

root@kali:~# apt install -y x11vnc

设置密码

root@kali:~# x11vnc -storepasswd

设置服务

新建/lib/systemd/system/x11vnc.service

[Unit]
Description=Start x11vnc at startup.
After=multi-user.target

[Service]
Type=simple
ExecStart=x11vnc -display :0 -auth /var/run/lightdm/root/:0 -forever -bg -o /var/log/x11vnc.log -rfbport 5900 -loop
#-rfbauth ~/.vnc/passwd

[Install]
WantedBy=multi-user.target

设置开机自启动

root@kali:~# systemctl daemon-reload
root@kali:~# systemctl enable x11vnc.service
root@kali:~# systemctl start x11vnc.service

realvnc for armhf 安装

vnc_pkg='VNC-Server-6.6.0-Linux-ARM.deb' ; \
sudo \
sed -i '/deb http:\/\/mirrors.tuna.tsinghua.edu.cn\/debian\/ sid main non-free contrib/d' \
/etc/apt/sources.list ; \
sudo apt clean all ; \
sudo echo 'deb http://mirrors.tuna.tsinghua.edu.cn/debian/ sid main non-free contrib' \
>>/etc/apt/sources.list ; \
sudo dpkg --add-architecture armhf ; sudo apt update ; \
cd ~ ; wget https://www.realvnc.com/download/file/vnc.files/$vnc_pkg ; \
sudo apt install ./$vnc_pkg ; \
rm -rf ./$vnc_pkg ; \
sudo dpkg --remove-architecture armhf ; sudo apt update ; \
sudo systemctl enable vncserver-x11-serviced.service ; \
sudo systemctl start vncserver-x11-serviced.service ; \
sudo \
sed -i '/deb http:\/\/mirrors.tuna.tsinghua.edu.cn\/debian\/ sid main non-free contrib/d' \
/etc/apt/sources.list ; \
sudo apt clean all ; sudo apt update

启动或停止RealVNC服务:

systemctl (start-stop) vncserver-x11-service.service

启用或取消RealVNC服务开机自启动:

systemctl (enable-disable) vncserver-x11-service.service

杀死所有相关的服务进程:

killall vncserver-x11-core vncserver-x11 vncagent vncserverui

更改分辨率

nano /boot/config.text
hdmi_group=2
hdmi_mode=85
hdmi_drive=2

 

你可能感兴趣的:(在树莓派4b上安装kali linux 2019.4并启用vnc服务)