vnc-server
  8FFsoXRpcNzh 2023年11月13日 20 0

vnc-server

vnc-server是一个可视化的图形界面的管理工具,在Linux安装上相应的服务之后。在Windows端就可以打开一个图形的终端就行控制。

#装图形界面
[root@gby ~]# yum -y  group install "Server with GUI"
[root@gby ~]# yum update
#安装vnc软件
[root@gby ~]# yum -y install tigervnc-server
[root@gby ~]# reboot
#切换普通用户
[root@gby ~]# su - gby
Last login: Mon Mar 27 15:40:11 CST 2023 on pts/0
[gby@gby ~]$ vncpasswd 
Password: #密码
Verify: #密码
Would you like to enter a view-only password (y/n)? n #是否要输入仅查看的密码
A view-only password is not used
[gby@gby ~]$ vncserver :30

WARNING: vncserver has been replaced by a systemd unit and is now considered deprecated and removed in upstream.
Please read /usr/share/doc/tigervnc/HOWTO.md for more information.
xauth:  file /home/gby/.Xauthority does not exist

New 'gby:30 (gby)' desktop is gby:30

Creating default startup script /home/gby/.vnc/xstartup
Creating default config /home/gby/.vnc/config
Starting applications specified in /home/gby/.vnc/xstartup
Log file is /home/gby/.vnc/gby:30.log

[gby@gby ~]$ vncserver -list

WARNING: vncserver has been replaced by a systemd unit and is now considered deprecated and removed in upstream.
Please read /usr/share/doc/tigervnc/HOWTO.md for more information.

TigerVNC server sessions:

X DISPLAY #     PROCESS ID
:30             4679
[gby@gby ~]$ netstat -anpt |grep 5930
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
tcp        0      0 0.0.0.0:5930            0.0.0.0:*               LISTEN      4679/Xvnc
tcp6       0      0 :::5930                 :::*                    LISTEN      4679/Xvnc
[gby@gby ~]$ exit
logout
[root@gby ~]# systemctl disable firewalld --now

vnc-server_图形界面

vnc-server_vnc_02

vnc-server_图形界面_03


#vnc进程的systemctl文件
[root@gby ~]# cat /etc/systemd/system/vncserver@.service 
[Unit]
Description=Remote Desktop VNC Service
After=syslog.target network.target
[Service]
Type=forking
WorkingDirectory=/home/gby
User=gby
Group=gby
ExecStartPre=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'
ExecStart=/usr/bin/vncserver -autokill %i
ExecStop=/usr/bin/vncserver -kill %i
[Install]
WantedBy=multi-user.target
[root@gby ~]# systemctl enable  vncserver@:30.service --now
Created symlink /etc/systemd/system/multi-user.target.wants/vncserver@:30.service → /etc/systemd/system/vncserver@.service.
[root@gby ~]# systemctl status vncserver@:30.service
● vncserver@:30.service - Remote Desktop VNC Service
     Loaded: loaded (/etc/systemd/system/vncserver@.service; enabled; preset: disabled)
     Active: active (running) since Sat 2023-04-15 18:16:14 CST; 1min 33s ago
    Process: 11105 ExecStartPre=/bin/sh -c /usr/bin/vncserver -kill :30 > /dev/null 2>&1 || : (code=exited, status=0/SUCCESS)
    Process: 11111 ExecStart=/usr/bin/vncserver -autokill :30 (code=exited, status=0/SUCCESS)
      Tasks: 217 (limit: 23052)
     Memory: 465.2M
        CPU: 6.656s
     CGroup: /system.slice/system-vncserver.slice/vncserver@:30.service
             ├─11118 /usr/bin/Xvnc :30 -auth /home/gby/.Xauthority -desktop "gby:30 (gby)" -fp catalogue:/etc/X11/fontpath.d -geometry 1024x768 -pn -rfbauth /home/gby/.>
             ├─11123 sh -c "(/home/gby/.vnc/xstartup; /usr/bin/vncserver -kill :30) >> '/home/gby/.vnc/gby:30.log' 2>&1 &"
             ├─11124 /bin/sh /home/gby/.vnc/xstartup
             ├─11125 /usr/libexec/gnome-session-binary
             ├─11134 dbus-launch --sh-syntax --exit-with-session
             ├─11135 /usr/bin/dbus-daemon --syslog --fork --print-pid 5 --print-address 7 --session
             ├─11142 /usr/bin/ssh-agent /etc/X11/xinit/Xclients
             ├─11154 /usr/libexec/at-spi-bus-launcher
             ├─11159 /usr/bin/dbus-daemon --config-file=/usr/share/defaults/at-spi2/accessibility.conf --nofork --print-address 3
             ├─11163 /usr/libexec/gvfsd
             ├─11168 /usr/libexec/gvfsd-fuse /home/gby/.cache/gvfs -f
             ├─11187 /usr/bin/gnome-keyring-daemon --start --components=ssh
             ├─11197 /usr/bin/gnome-shell
             ├─11212 ibus-daemon --panel disable --xim

结束之有话想说

既然看完了那就赶紧去试试吧骚年。👊

【版权声明】本文内容来自摩杜云社区用户原创、第三方投稿、转载,内容版权归原作者所有。本网站的目的在于传递更多信息,不拥有版权,亦不承担相应法律责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@moduyun.com

  1. 分享:
最后一次编辑于 2023年11月13日 0

暂无评论

推荐阅读
  6YY0QMPUXEwu   2023年12月10日   30   0   0 linux网卡
  nIt0XG0acU8j   2023年12月11日   29   0   0 linuxhtop
  nIt0XG0acU8j   2023年12月09日   33   0   0 linuxsort