gpt4 book ai didi

sudo - 除非以 sudo 启动,否则tigervncserver 会崩溃

转载 作者:行者123 更新时间:2023-12-03 17:01:48 30 4
gpt4 key购买 nike

我已经安装了以下 pkgs:

ii  tigervnc-common                          1.10.1+dfsg-1                        amd64        Virtual network computing; Common software needed >
ii tigervnc-standalone-server 1.10.1+dfsg-1 amd64 Standalone virtual network computing server
ii tigervnc-viewer 1.10.1+dfsg-1 amd64 Virtual network computing client for X
ii tigervnc-xorg-extension 1.10.1+dfsg-1 amd64 Virtual network computing X server extension

我已经运行了 vncserver 并配置了 passwd 并且没有添加任何其他配置。

(这是一个已经工作的 VNC session )没有 sudo 的命令:
root@kali:~# vncserver -localhost

New 'kali.'"'':2 (root)' desktop at :2 on machine kali.'"''

Starting applications specified in /etc/X11/Xvnc-session
Log file is /root/.vnc/kali.'"'':2.log

Use xtigervncviewer -SecurityTypes VncAuth -passwd /root/.vnc/passwd :2 to connect to the VNC server.


vncserver: Failed command '/etc/X11/Xvnc-session': 256!

=================== tail -15 /root/.vnc/kali.'"'':2.log ===================

Xvnc TigerVNC 1.10.0 - built Dec 30 2019 14:38:21
Copyright (C) 1999-2019 TigerVNC Team and many others (see README.rst)
See https://www.tigervnc.org for information on TigerVNC.
Underlying X server release 12006000, The X.Org Foundation


Sun Jan 12 18:52:25 2020
vncext: VNC extension running!
vncext: Listening for VNC connections on local interface(s), port 5902
vncext: created VNC server for screen 0
X connection to :2 broken (explicit kill or server shutdown).
ComparingUpdateTracker: 0 pixels in / 0 pixels out
ComparingUpdateTracker: (1:-nan ratio)
Killing Xtigervnc process ID 4108... which seems to be deadlocked. Using SIGKILL!

===========================================================================

Starting applications specified in /etc/X11/Xvnc-session has failed.
Maybe try something simple first, e.g.,
tigervncserver -xstartup /usr/bin/xterm

使用 sudo 运行时,此方法有效:
root@kali:~# sudo vncserver -localhost

New 'kali.'"'':2 (root)' desktop at :2 on machine kali.'"''

Starting applications specified in /etc/X11/Xvnc-session
Log file is /root/.vnc/kali.'"'':2.log

Use xtigervncviewer -SecurityTypes VncAuth -passwd /root/.vnc/passwd :2 to connect to the VNC server.

我是两者的根 - 所以我想了解为什么 sudo 会有所作为

最佳答案

使用以下内容创建可执行文件 ~/.vnc/xstartup:

#!/bin/bash

PATH=/usr/bin:/usr/sbin
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
exec startxfce4 &
对于 exec 值,请检查您的桌面 session :
ls /usr/share/xsessions/
在那里你会找到 .desktop 文件,例如:
cinnamon2d.desktop  cinnamon.desktop  gnome.desktop  gnome-xorg.desktop  
kodi.desktop
使用您对 vnc session 感兴趣的桌面环境打开文件,并在那里检查 Exec 变量,对我来说它是 cinnamon-session-cinnamon。所以我的 ~/.vnc/xstartup 看起来像这样:
#!/bin/bash

PATH=/usr/bin:/usr/sbin
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
exec cinnamon-session-cinnamon &
在此 vncserver 应该在没有任何 sudo 要求的情况下启动之后,至少在我的情况下是这样。我猜缺少可执行文件会阻止 vncserver 启动,但是使用 sudo 权限,它设法从仅 sudoers 可访问的某些文件中提取的默认设置开始。

关于sudo - 除非以 sudo 启动,否则tigervncserver 会崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59709214/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com