近期在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. HZAU 1199 Little Red Riding Hood(DP)

    Little Red Riding Hood Time Limit: 1 Sec  Memory Limit: 1280 MBSubmit: 853  Solved: 129[Submit][Stat ...

  2. 在intellij idea 中进行android 单元测试

    本次用来测试的代码是sqlite进行数据操作. ######右键选择要进行单元测试的应用 #############弹出选择框,选择Android>Test Module>Next ### ...

  3. 【朱-刘算法】【最小树形图】hdu6141 I am your Father!

    题意:给你一张带权有向图,让你求最大树形图.并在此前提下令n号结点父亲的编号最小. 比赛的时候套了个二分,TLE了. 实际上可以给每个边的权值乘1000,对于n号结点的父边,加上(999-父结点编号) ...

  4. svn出现Authorization failed

    进入svn的conf目录下 修改svnserve.conf [general] anon-access = read auth-access = write password-db = passwd ...

  5. Problem C: 指针:自定义函数length,调用它计算字符串的长度

    #include<stdio.h> int length(char*s) { int i,count; while(*s!='\0') { *(s++); count++; } retur ...

  6. github之怎么上传本地项目

    github之怎么上传本地项目 以前都是在自己磁盘上的某个目录下,然后打开git bash,来进行把本地的一些文件推到远程github上. 之前的方法步骤: 1.在github上new一个库,然后gi ...

  7. Android获取apk的版本及包名等信息

    import android.app.Activity; import android.content.Context; import android.content.pm.ApplicationIn ...

  8. redis_常用命令

    一.启动redis客户端 cmd   cd D:\Project\redis-2.8.17   redis-cli.exe     二.常用命令   参考文档:http://redisdoc.com/ ...

  9. 十大流行linux

    你可曾知道Linux的魅力或威力来自哪里?那就是,由于众多发行版百花齐放,Linux的阵营日益壮大,每一款发行版都拥有一大批用户,开发者自愿为相关项目投入精力.Linux发行版可谓是形形色色,它们旨在 ...

  10. appium+python自动化45-夜神模拟器连不上(adb server version (36) doesn't match this client (39); killing...)

    前言 最新下了个最新版的夜神模拟器,然后adb devices发现连不上模拟器了,报adb server version (36) doesn't match this client (39); ki ...