近期在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. php获取农历、节日、节气

    /* * 农历 节气 节日 * edit: www.jbxue.com */ header("Content-Type:text/html;charset=utf-8"); cla ...

  2. Codeforces Round #300 Quasi Binary(DP)

    Quasi Binary time limit per test 2 seconds memory limit per test 256 megabytes input standard input ...

  3. CentOS7终端如何支持中文显示

    注意,是终端,而不是控制台.目前我没找到有控制台显示中文的(fbterm好像可以,有时间试试),如果大家知道,请务必告诉我 (1).查看系统是否安装中文包 [xf@xuexi ~]$ locale - ...

  4. 【FFT】hdu1402 A * B Problem Plus

    FFT板子. 将大整数看作多项式,它们的乘积即多项式的乘积在x=10处的取值. #include<cstdio> #include<cmath> #include<cst ...

  5. Train Problem I(模拟栈)

    题意:模拟栈,试问使用2个栈,能否使得串1变为串2 思路:模拟,经典问题,注意只要相同的元素放到栈顶后就不会再移动了,只需要考虑剩下的元素,因此每次只考虑一个元素的进入方式. #include< ...

  6. Codeforces Beta Round #2 B. The least round way dp

    B. The least round way 题目连接: http://www.codeforces.com/contest/2/problem/B Description There is a sq ...

  7. Windows使用OpenVPN客户端连接

    前提: 1.上官网下载Windows客户端:https://openvpn.net/index.php/open-source/downloads.html 安装: 1.默认安装,选择easy-rsa ...

  8. 用GDB 调试Java程序

      陈皓 http://blog.csdn.net/haoel 背景 想要使用GDB调试程序,就需要用GNU的编译器编译程序.如:用GCC编译的C/C++的程序,才能用GDB调试.对于Java程序也是 ...

  9. ThreadLocal用法详解和原理(转)

    本文转自https://www.cnblogs.com/coshaho/p/5127135.html 感谢作者 一.用法 ThreadLocal用于保存某个线程共享变量:对于同一个static Thr ...

  10. mysql join优化

    http://www.jb51.net/article/50427.htm 七.性能优化1.显示(explicit) inner join VS 隐式(implicit) inner join 如: ...