近期在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. Bzoj2818 Gcd(莫比乌斯反演)

    题面 题意都在题目里面了 题解 你可以把题意看成这个东西 $$ \sum_{i=1}^n\sum_{j=1}^m\mathbf f(gcd(i,j)) $$ 其中$\mathbf f(n)$为$是否是 ...

  2. TarjanLCA学习笔记

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

  3. Codeforces Round #426 (Div. 2) D The Bakery(线段树 DP)

     The Bakery time limit per test 2.5 seconds memory limit per test 256 megabytes input standard input ...

  4. Sqli-labs less 7

    Less-7 本关的标题是dump into outfile,意思是本关我们利用文件导入的方式进行注入.而在background-3中我们已经学习了如何利用dump into file. 这里首先还是 ...

  5. Sqli-labs less 8

    Less-8 经过简单的测试,我们发现 'or 1=1--+返回正常,那么我们就基本知道应该怎么使用了,参考less5.这里简单的进行一个示例: http://127.0.0.1/sqllib/Les ...

  6. BZOJ 1260 [CQOI2007]涂色paint(区间DP)

    [题目链接] http://www.lydsy.com/JudgeOnline/problem.php?id=1260 [题目大意] 假设你有一条长度为n的木版,初始时没有涂过任何颜色 每次你可以把一 ...

  7. 【动态规划】Codeforces Round #406 (Div. 2) C.Berzerk

    有向图博弈问题. 能转移到一个必败态的就是必胜态. 能转移到的全是必胜态的就是必败态. 转移的时候可以用队列维护. 可以看这个 http://www.cnblogs.com/quintessence/ ...

  8. 【FFT】HDU4609-3 idiots

    ..退化为一天两题了,药丸.. [题目大意] 给出n根木棍的长度,求从其中取出3根能组成三角形的概率. [思路] 然后枚举求前缀和,枚举最长边.假设最长边为l,先求出所有两边之和大于它的情况数.然后减 ...

  9. matlab2016b ubuntu命令行安装 + matconvnet的安装

    0. 下载安装包 下载的文件有Matlab 2016b Linux64 Crack.rar,R2016b_glnxa64_dvd2.iso,R2016b_glnxa64_dvd1.iso. 1. 拷贝 ...

  10. redis源码解析之事件驱动

    Redis 内部有个小型的事件驱动,它主要处理两项任务: 文件事件:使用I/O多路复用技术处理多个客户端请求,并返回执行结果. 时间事件:维护服务器的资源管理,状态检查. 主要的数据结构包括文件事件结 ...