当前位置: 首页 > news >正文

linux vnc登录日志,CentOS安装使用VNC进行远程桌面登录

以下介绍在CentOS 7下安装vncserver并使用vnc-viewer进行登录(使用root权限):

1、运行命令yum install tigervnc-server安装vncserver;

2、运行命令yum install vnc安装vnc;//感觉不安装也可以,安装一下也很快,不要在意这些细节

3、运行命令yum groupinstall "X Window System"安装X-Window;//之前安装发现经常无法启动vncserver,后面通过网上查资料介绍可以安装X-Window解决这个 问题

4、安装中文字符以解决界面中文乱码的问题:yum install dejavu-lgc-sans-fonts、yum groupinstall "Fonts" -y

5、禁用防火墙,如果已经禁用防火墙可以跳过这一步:systemctl stop firewalld.service、systemctl disable firewalld.service

6、配置vncserver:

拷贝创建一个新的配置文件,以开启1号窗口为例,如果需要开启多个则创建多个配置文件即可:

[root@localhost ~]# cp /lib/systemd/system/vncserver@.service /lib/systemd/system/vncserver@:1.service

修改配置文件内容

[root@localhost ~]# vi /lib/systemd/system/vncserver@:1.service

# The vncserver service unit file

#

# Quick HowTo:

# 1. Copy this file to /etc/systemd/system/vncserver@.service

# 2. Replace with the actual user name and edit vncserver

# parameters appropriately

# ("User=" and "/home//.vnc/%H%i.pid")

# 3. Run `systemctl daemon-reload`

# 4. Run `systemctl enable vncserver@:.service`

#

# DO NOT RUN THIS SERVICE if your local area network is

# untrusted! For a secure way of using VNC, you should

# limit connections to the local host and then tunnel from

# the machine you want to view VNC on (host A) to the machine

# whose VNC output you want to view (host B)

#

# [user@hostA ~]$ ssh -v -C -L 590N:localhost:590M hostB

#

# this will open a connection on port 590N of your hostA to hostB's port 590M

# (in fact, it ssh-connects to hostB and then connects to localhost (on hostB).

# See the ssh man page for details on port forwarding)

#

# You can then point a VNC client on hostA at vncdisplay N of localhost and with

# the help of ssh, you end up seeing what hostB makes available on port 590M

#

# Use "-nolisten tcp" to prevent X connections to your VNC server via TCP.

#

# Use "-localhost" to prevent remote VNC clients connecting except when

# doing so through a secure tunnel. See the "-via" option in the

# `man vncviewer' manual page.

[Unit]

Description=Remote desktop service (VNC)

After=syslog.target network.target

[Service]

Type=forking

User=root

# Clean any existing files in /tmp/.X11-unix environment

ExecStartPre=-/usr/bin/vncserver -kill %i

ExecStart=/usr/bin/vncserver %i

PIDFile=/root/.vnc/%H%i.pid

ExecStop=-/usr/bin/vncserver -kill %i

[Install]

WantedBy=multi-user.target

7、运行命令systemctl daemon-reload更新systemctl;

8、运行命令vncpasswd root设置vncserver的密码;

9、运行命令systemctl start vncserver@:1.service(可以运行systemctl enable vncserver@:1.service命令设置为默认启动服务);//启动不了则重启一下系统或则查看启动日志

10、重启系统后使用VNC-Viewer连接:192.168.10.100:1,输入设置的密码即可登录。

0b1331709591d260c1c78e86d0c51c18.png

相关文章:

  • 鸟哥linux视频教程密码,[鸟哥linux视频教程整理]04_01_Linux用户管理命令详解
  • linux memcpy 地址对齐,在memcpy中对齐源地址和目标地址
  • 红帽企业级Linux.As版,晋级Linux中的默认JDK的版本
  • linux xen 参数配置,XEN linux虚拟机配置实例
  • linux cpu占用分析,Linux下CPU占用率高分析方法
  • linux信号处理响应异步事件,Linux并发(异步信号)
  • redis 3.0.0 linux下载,Redis可视化管理软件RedisPlus 3.0.0下载,优化了性能及交互体验...
  • c语言阶乘 ii多测试,C语言经典题目:求阶乘n!=n*(n-1)*...*1,阶乘和s=1!+(2)!+(3)!+...+n!...
  • 利用c语言实现几何图形旋转,[平顶山学院高等数学C语言试题.doc
  • linux子系统adb,[ubuntu] win10中linux子系统增加adb调试功能
  • android 媒体按钮,如何使用新的MediaSession类在Android 5.x上接收媒体按钮?
  • android按钮图,android-UI组件实例大全(三)------按钮Button与图片按钮ImageButton
  • android jmdns,jmdns.jar 通信
  • 锁定当前屏幕触摸android,Android解锁屏幕,然后重新锁定屏幕(Nook简单触摸)
  • 华为鸿蒙os2.0版适用机型,鸿蒙os2.0支持机型_华为鸿蒙os2.0系统支持什么手机
  • 【css3】浏览器内核及其兼容性
  • 【刷算法】从上往下打印二叉树
  • Android框架之Volley
  • canvas 绘制双线技巧
  • JavaScript的使用你知道几种?(上)
  • nginx(二):进阶配置介绍--rewrite用法,压缩,https虚拟主机等
  • Spring Cloud Alibaba迁移指南(一):一行代码从 Hystrix 迁移到 Sentinel
  • storm drpc实例
  • vagrant 添加本地 box 安装 laravel homestead
  • VuePress 静态网站生成
  • 前端面试总结(at, md)
  • Spring第一个helloWorld
  • 小白应该如何快速入门阿里云服务器,新手使用ECS的方法 ...
  • ​flutter 代码混淆
  • ​linux启动进程的方式
  • ​你们这样子,耽误我的工作进度怎么办?
  • ### Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException
  • (09)Hive——CTE 公共表达式
  • (react踩过的坑)Antd Select(设置了labelInValue)在FormItem中initialValue的问题
  • (附源码)ssm高校升本考试管理系统 毕业设计 201631
  • (十六)Flask之蓝图
  • (算法)Game
  • (学习日记)2024.03.25:UCOSIII第二十二节:系统启动流程详解
  • (译) 理解 Elixir 中的宏 Macro, 第四部分:深入化
  • (转)Linq学习笔记
  • (转贴)用VML开发工作流设计器 UCML.NET工作流管理系统
  • (转载)深入super,看Python如何解决钻石继承难题
  • .net core 依赖注入的基本用发
  • .net core开源商城系统源码,支持可视化布局小程序
  • .pub是什么文件_Rust 模块和文件 - 「译」
  • @reference注解_Dubbo配置参考手册之dubbo:reference
  • @RequestMapping-占位符映射
  • [ 2222 ]http://e.eqxiu.com/s/wJMf15Ku
  • [ C++ ] STL_list 使用及其模拟实现
  • [Android]Tool-Systrace
  • [BZOJ3211]:花神游历各国(小清新线段树)
  • [CTO札记]如何测试用户接受度?
  • [Git].gitignore失效的原因
  • [hdu1561] The more, The Better 【树形DP】
  • [HNOI2008]玩具装箱toy