近期在VPS上搭建Python Web环境。走了非常多弯路,借此记下。

先说说购买的VPS(PhotonVPS),我可不是打广告。仅仅是感觉这个VPS服务提供商还不错推荐给你大家,我之前也是体验过阿里云的。体验结果就不说了。反正不适合我。

使用系统是CentOS 64位,版本号是 6.5。至于VNC的介绍,大家能够移步官网查看,以下就開始VNC的下载与配置了。

1. 通过SSH远程连接VPS主机,Windows的小伙伴们能够下载SSHclient进行连接。

ssh [username]@[IP地址]

2. 通过yum安装VNC

yum install tigervnc tigervnc-server -y

3. 安装桌面服务(VPS自带的系统一般都不会有桌面服务)

yum groupinstall -y "Desktop" "X Window System"

4. 安装完毕后。运行vncserver。初始化password

[root@sunth ~]# vncserver

You will require a password to access your desktops.

Password:
Verify:
xauth: creating new authority file /root/.Xauthority
xauth: (stdin):1: bad display name "sunth.localdomain:1" in "add" command New 'sunth.localdomain:1 (root)' desktop is sunth.localdomain:1 Creating default startup script /root/.vnc/xstartup
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/sunth.localdomain:1.log

5. 改动刚刚生成的文件    /root/.vnc/xstartup

vi /root/.vnc/xstartup

将文件最后一行的 twn & 更改为 gnome-session &

更改后的文件:

#!/bin/sh

[ -r /etc/sysconfig/i18n ] && . /etc/sysconfig/i18n
export LANG
export SYSFONT
vncconfig -iconic &
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
OS=`uname -s`
if [ $OS = 'Linux' ]; then
case "$WINDOWMANAGER" in
*gnome*)
if [ -e /etc/SuSE-release ]; then
PATH=$PATH:/opt/gnome/bin
export PATH
fi
;;
esac
fi
if [ -x /etc/X11/xinit/xinitrc ]; then
exec /etc/X11/xinit/xinitrc
fi
if [ -f /etc/X11/xinit/xinitrc ]; then
exec sh /etc/X11/xinit/xinitrc
fi
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
gnome-session &

6. 改动配置文件 /etc/sysconfig/vncservers

vi /etc/sysconfig/vncservers

在文件最后,加上显示配置与用户配置

VNCSERVERS="1:root"
VNCSERVERARGS[2]="-geometry 1024x768"

改动后的文件:

# The VNCSERVERS variable is a list of display:user pairs.
#
# Uncomment the lines below to start a VNC server on display :2
# as my 'myusername' (adjust this to your own). You will also
# need to set a VNC password; run 'man vncpasswd' to see how
# to do that.
#
# DO NOT RUN THIS SERVICE if your local area network is
# untrusted! For a secure way of using VNC, see this URL:
# http://kbase.redhat.com/faq/docs/DOC-7028 # 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. VNCSERVERS="1:root"
VNCSERVERARGS[2]="-geometry 1024x768"

7. 最后重新启动vnserver

[root@sunth ~]# service vncserver start
Starting VNC server: 1:root A VNC server is already running as :1
[FAILED]
[root@sunth ~]# service vncserver restart
Shutting down VNC server: 1:root [ OK ]
Starting VNC server: 1:root xauth: (stdin):1: bad display name "sunth.localdomain:1" in "add" command New 'sunth.localdomain:1 (root)' desktop is sunth.localdomain:1 Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/sunth.localdomain:1.log [ OK ]

8. 在官网能够下载client,然后就能够远程桌面了,就写到这。

watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvc3VudGh4/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="">

watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvc3VudGh4/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="">

【一步一步走(1)】远程桌面软件VNC的安装与配置的更多相关文章

  1. ubuntu远程桌面软件vnc。

    http://www.linuxidc.com/Linux/2017-03/141936.htm 现在Linux是非常火的  很多人喜欢用它,界面简单,操作容易,有很多图形化工具如WinSCP可以与U ...

  2. ubuntu远程桌面、VNC(转载)

    VNC 远程桌面 配置/使用 for xfce 本贴主要目的为说明如何在windows系统下远程控制xfce桌面 Ubuntu 的默认GNOME桌面可以在系统设置中直接打开远程桌面,然后用Window ...

  3. 远程桌面软件RDCMan汉化版

    自己汉化的远程桌面控制软件RDCMan--Remote Desktop Connection Manager(RDCMan) v2.7 简体中文汉化版. 介绍 Remote Desktop Conne ...

  4. 多服务器 vps 管理方法,十款远程桌面软件测评分析

    作为运维工作者,从几年前巨大的工作量到如今有了极大的改善,这些年试用的远程桌面管理软件不在少数. 远程桌面是微软公司为了方便网络管理员管理维护服务器而推出的一项服务.从windows 2000 ser ...

  5. Ubuntu 14.04远程登录服务器--ssh的安装和配置

    ssh是一种安全协议,主要用于给远程登录会话数据进行加密,保证数据传输的安全,现在介绍一下如何在Ubuntu 14.04上安装和配置ssh 1.更新源列表 打开"终端窗口",输入& ...

  6. linux远程桌面连接 VNC Server

    更新源 # sudo apt-get update 安装vnc4server # sudo apt-get install vnc4server 修改vnc远程连接密码 # vncpasswd 编辑v ...

  7. 树莓派远程桌面--使用windows自带的远程桌面软件mstsc.exe

    步骤: 1.使用SSH登录树莓派 2.安装xrdp服务: sudo apt-get install xrdp 3.在Windows下打开命令框运行:mstsc 4.登录树莓派桌面 5.登录成功

  8. Mac-连接Windows远程桌面软件

    链接:https://download.csdn.net/download/ab601026460/9885775 https://blog.csdn.net/ab601026460/article/ ...

  9. Ubuntu 远程登录服务器--ssh的安装和配置

    Ubuntu的安装包居然不自带openssh服务器,所以若要使用ssh远程登录Ubuntu主机,需要首先安装ssh服务器: sudo apt-get install openssh-server 安装 ...

随机推荐

  1. 【转载】Banner框架

    原文地址:https://github.com/youth5201314/banner 以前banner都自己写,又丑问题又多,在github上找到一个点赞最多的,动画效果那是绚丽多彩啊,好东东当然要 ...

  2. TarjanLCA学习笔记

    1.前言 首先我们介绍的算法是LCA问题中的离线算法-Tarjan算法,该算法采用DFS+并查集,再看此算法之前首先你得知道并查集(尽管我相信你如果知道这个的话肯定是知道并查集的),Tarjan算法的 ...

  3. JDBC 编程初步

    JDBC 概述 什么是JDBC 是一种用于执行SQL语句的Java API,它由一组用Java语言编写的类和接口组成,JDBC提供了一种操作数据的标准,JDBC的目标是使Java程序员使用JDBC可以 ...

  4. ES6的let和const命令

    刚开始学习es6,心里有点方,因为看了前言,感觉要用什么bebal来翻译成es5的代码,才能在各个平台上兼容运行,还有node各种运行环境. 不过自己也去百度了一些,发现还是有一丢丢的困难. 言归正传 ...

  5. 解决eclipse中java代码注释变成乱码的问题

    Eclipse JAVA文件注释乱码将别人的项目或JAVA文件导入到自己的Eclipse中时,常常会出现JAVA文件的中文注释变成乱码的情况,主要原因就是别人的IDE编码格式和自己的Eclipse编码 ...

  6. Microsoft office(2)多级标题的设置

    在Microsoft office中要达到下面的标题结构: 1.首先将文字准备好: 2.将“绪论”,“无线...介绍”等章节标题分别选中 :段落-->大纲级别-->1级 3.同样的,“研究 ...

  7. 【LaTeX】E喵的LaTeX新手入门教程(3)数学公式

    昨天熄灯了真是坑爹.前情回顾[LaTeX]E喵的LaTeX新手入门教程(1)准备篇 [LaTeX]E喵的LaTeX新手入门教程(2)基础排版上一期测试答案1.大家一开始想到的肯定是\LaTeX{}er ...

  8. myEclipse的配置

  9. 破解IDEA Ultimate2017 测试

    转载:http://blog.csdn.net/linyanqing21/article/details/72594352 IntelliJ Idea 2017 免费激活方法: 1.到网站 http: ...

  10. UVa 164 - String Computer

    题目:编辑距离.给你两个串,将已知串转化成目标串,能够增.删.改字母,求最小操作次数. 分析:dp,编辑距离.同最大公共子序列. 注意操作位置是实时变化的. (前面都已经处理好了)           ...