vncserver non-root user
Start vncserver by non-root user.
User: <your_name>
<your_name>@<your_name>] sudo vi /etc/sysconfig/vncservers
VNCSERVERS="2:<your_name>"
#VNCSERVERARGS[2]="-geometry 800x600 -nolisten tcp -nohttpd -localhost"
VNCSERVERARGS[2]="-geometry 1368x768"
<your_name>@<your_name>] vncserver :2 -geometry 1366x768
New '<your_name>.desktop.aaa.com:2 (<your_name>)' desktop is <your_name>.desktop.aaa.com:2
Starting applications specified in /home/<your_name>/.vnc/xstartup
Log file is /home/<your_name>/.vnc/<your_name>.desktop.aaa.com:2.log
Then connect the server using vnc viewer from your PC through the :2 session.
If you meet such error:
<your_name>@<your_name>] sudo vncserver :1 -name <your_name> -geometry 1368x768
xauth: error in locking authority file /home/<your_name>/.Xauthority
Just verify the permission of the .Xauthority file. It should be :
<your_name>@<your_name>] ll /home/<your_name>/.Xauthority
-rw------- 2 <your_name> aaa 0 Dec 12 09:15 /home/<your_name>/.Xauthority
<your_name>@<your_name>] sudo chown <your_name>:aaa /home/<your_name>/.Xauthority
<your_name>@<your_name>] sudo chmod 600 /home/<your_name>/.Xauthority
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步