Linux上VNC常见命令

参考链接:

http://blog.csdn.net/russle/article/details/4757888

http://www.linuxidc.com/Linux/2016-06/132024.htm

VNC安装步骤

1、下载vncserver

yum install tigervnc tigervnc-server –y

2、配置当前用户的vnc登陆密码,连续输入两次即可。这个密码是vnc连接密码,和系统密码没有关系。可以不一样。
[root@localhost ~]# vncpasswd 
Password:
Verify:
[root@localhost ~]#

3、启动vncserver服务。

第一次启动时这样操作  直接输入 vncserver 
系统会自动建立相关的配置文件和日志文件。启动后系统会提示出一个进程号为1的窗口。
如果需要启动两个窗口的话则再次执行VNCSERVER 命令即可。
[root@localhost X11]# vncserver 

修改密码

[root@xxxxx ~]# vncpasswd 

Password:
Verify:
[root@xxxxx ~]# 

关闭VNC

1、查找进程、杀进程

[root@xxxxx ~]#  ps -ef|grep -i vnc 

root 3889 1 0 Aug21 ? 00:34:34 /usr/bin/Xvnc :1 -desktop portaltest01:1 (root) -auth /root/.Xauthority -geometry 1024x768 -rfbwait 30000 -rfbauth /root/.vnc/passwd -rfbport 5901 -fp catalogue:/etc/X11/fontpath.d -pn
root 41606 1 0 Sep11 ? 00:29:42 /usr/bin/Xvnc :3 -desktop portaltest01:3 (root) -auth /root/.Xauthority -geometry 1024x768 -rfbwait 30000 -rfbauth /root/.vnc/passwd -rfbport 5903 -fp catalogue:/etc/X11/fontpath.d -pn
root 84297 1 0 Sep08 ? 00:29:47 /usr/bin/Xvnc :2 -desktop portaltest01:2 (root) -auth /root/.Xauthority -geometry 1024x768 -rfbwait 30000 -rfbauth /root/.vnc/passwd -rfbport 5902 -fp catalogue:/etc/X11/fontpath.d -pn
 

手动杀掉进程 84297,并验证

[root@xxxxx ~]# kill -9 84297

[root@xxxxx ~]#  ps -ef|grep -i vnc 

 2、执行命令

通过vncserver kill :1,:2,这是最好的方法,推荐使用

[root@xxxxx ~]## vncserver  -kill :1 

原文地址:https://www.cnblogs.com/jzhg/p/7878637.html