VNC服务端自动化配置脚本
在使用阿里云的linux云主机,看到官方提供的远程连接服务器bash脚本,记录下来。
K)
#!/bin/bash
#########################################
#Function: install vnc server
#Usage: bash install_vnc_server.sh
#Author: Customer service department
#Company: Alibaba Cloud Computing
#Version: 1.0
#########################################
check_os_release()
{
while true
do
os_release=$(grep "Red Hat Enterprise Linux Server release" /etc/issue 2>/dev/null)
os_release_2=$(grep "Red Hat Enterprise Linux Server release" /etc/redhat-release 2>/dev/null)
if [ "$os_release" ] && [ "$os_release_2" ]
then
if echo "$os_release"|grep "release 5" >/dev/null 2>&1
then
os_release=redhat5
echo "$os_release"
elif echo "$os_release"|grep "release 6" >/dev/null 2>&1
then
os_release=redhat6
echo "$os_release"
else
os_release=""
echo "$os_release"
fi
break
fi
os_release=$(grep "CentOS release" /etc/issue 2>/dev/null)
os_release_2=$(grep "CentOS release" /etc/*release 2>/dev/null)
if [ "$os_release" ] && [ "$os_release_2" ]
then
if echo "$os_release"|grep "release 5" >/dev/null 2>&1
then
os_release=centos5
echo "$os_release"
elif echo "$os_release"|grep "release 6" >/dev/null 2>&1
then
os_release=centos6
echo "$os_release"
else
os_release=""
echo "$os_release"
fi
break
fi
os_release=$(grep -i "ubuntu" /etc/issue 2>/dev/null)
os_release_2=$(grep -i "ubuntu" /etc/lsb-release 2>/dev/null)
if [ "$os_release" ] && [ "$os_release_2" ]
then
if echo "$os_release"|grep "Ubuntu 10" >/dev/null 2>&1
then
os_release=ubuntu10
echo "$os_release"
elif echo "$os_release"|grep "Ubuntu 12" >/dev/null 2>&1
then
os_release=ubuntu12
echo "$os_release"
else
os_release=""
echo "$os_release"
fi
break
fi
os_release=$(grep -i "debian" /etc/issue 2>/dev/null)
os_release_2=$(grep -i "debian" /proc/version 2>/dev/null)
if [ "$os_release" ] && [ "$os_release_2" ]
then
if echo "$os_release"|grep "Linux 6" >/dev/null 2>&1
then
os_release=debian6
echo "$os_release"
else
os_release=""
echo "$os_release"
fi
break
fi
break
done
}
exit_script()
{
echo -e "\033[1;40;31mInstall $1 error,will exit.\n\033[0m"
rm -f $LOCKfile
exit 1
}
modify_rhel5_yum()
{
rpm --import http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-5
cd /etc/yum.repos.d/
wget http://mirrors.163.com/.help/CentOS-Base-163.repo -O CentOS-Base-163.repo
sed -i '/mirrorlist/d' CentOS-Base-163.repo
sed -i 's/\$releasever/5/' CentOS-Base-163.repo
yum clean metadata
yum makecache
cd ~
}
modify_rhel6_yum()
{
rpm --import http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6
cd /etc/yum.repos.d/
wget http://mirrors.163.com/.help/CentOS-Base-163.repo -O CentOS-Base-163.repo
sed -i '/mirrorlist/d' CentOS-Base-163.repo
sed -i '/\[addons\]/,/^$/d' CentOS-Base-163.repo
sed -i 's/\$releasever/6/' CentOS-Base-163.repo
sed -i 's/RPM-GPG-KEY-CentOS-5/RPM-GPG-KEY-CentOS-6/' CentOS-Base-163.repo
yum clean metadata
yum makecache
cd ~
}
update_ubuntu10_apt_source()
{
echo -e "\033[40;32mBackup the original configuration file,new name and path is /etc/apt/sources.list.back.\n\033[40;37m"
cp -fp /etc/apt/sources.list /etc/apt/sources.list.back
cat > /etc/apt/sources.list <<EOF
#ubuntu
deb http://cn.archive.ubuntu.com/ubuntu/ maverick main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ maverick-security main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ maverick-updates main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ maverick-proposed main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ maverick-backports main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu/ maverick main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu/ maverick-security main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu/ maverick-updates main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu/ maverick-proposed main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu/ maverick-backports main restricted universe multiverse
#163
deb http://mirrors.163.com/ubuntu/ maverick main universe restricted multiverse
deb-src http://mirrors.163.com/ubuntu/ maverick main universe restricted multiverse
deb http://mirrors.163.com/ubuntu/ maverick-security universe main multiverse restricted
deb-src http://mirrors.163.com/ubuntu/ maverick-security universe main multiverse restricted
deb http://mirrors.163.com/ubuntu/ maverick-updates universe main multiverse restricted
deb http://mirrors.163.com/ubuntu/ maverick-proposed universe main multiverse restricted
deb-src http://mirrors.163.com/ubuntu/ maverick-proposed universe main multiverse restricted
deb http://mirrors.163.com/ubuntu/ maverick-backports universe main multiverse restricted
deb-src http://mirrors.163.com/ubuntu/ maverick-backports universe main multiverse restricted
deb-src http://mirrors.163.com/ubuntu/ maverick-updates universe main multiverse restricted
#lupaworld
deb http://mirror.lupaworld.com/ubuntu/ maverick main universe restricted multiverse
deb-src http://mirror.lupaworld.com/ubuntu/ maverick main universe restricted multiverse
deb http://mirror.lupaworld.com/ubuntu/ maverick-security universe main multiverse restricted
deb-src http://mirror.lupaworld.com/ubuntu/ maverick-security universe main multiverse restricted
deb http://mirror.lupaworld.com/ubuntu/ maverick-updates universe main multiverse restricted
deb http://mirror.lupaworld.com/ubuntu/ maverick-proposed universe main multiverse restricted
deb-src http://mirror.lupaworld.com/ubuntu/ maverick-proposed universe main multiverse restricted
deb http://mirror.lupaworld.com/ubuntu/ maverick-backports universe main multiverse restricted
deb-src http://mirror.lupaworld.com/ubuntu/ maverick-backports universe main multiverse restricted
deb-src http://mirror.lupaworld.com/ubuntu/ maverick-updates universe main multiverse restricted
EOF
apt-get update
}
update_ubuntu12_apt_source()
{
echo -e "\033[40;32mBackup the original configuration file,new name and path is /etc/apt/sources.list.back.\n\033[40;37m"
cp -fp /etc/apt/sources.list /etc/apt/sources.list.back
cat > /etc/apt/sources.list <<EOF
#ubuntu
deb http://cn.archive.ubuntu.com/ubuntu/ precise main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ precise-security main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ precise-updates main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ precise-proposed main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ precise-backports main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu/ precise main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu/ precise-security main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu/ precise-updates main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu/ precise-proposed main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu/ precise-backports main restricted universe multiverse
#163
deb http://mirrors.163.com/ubuntu/ precise main restricted
deb-src http://mirrors.163.com/ubuntu/ precise main restricted
deb http://mirrors.163.com/ubuntu/ precise-updates main restricted
deb-src http://mirrors.163.com/ubuntu/ precise-updates main restricted
deb http://mirrors.163.com/ubuntu/ precise universe
deb-src http://mirrors.163.com/ubuntu/ precise universe
deb http://mirrors.163.com/ubuntu/ precise-updates universe
deb-src http://mirrors.163.com/ubuntu/ precise-updates universe
deb http://mirrors.163.com/ubuntu/ precise multiverse
deb-src http://mirrors.163.com/ubuntu/ precise multiverse
deb http://mirrors.163.com/ubuntu/ precise-updates multiverse
deb-src http://mirrors.163.com/ubuntu/ precise-updates multiverse
deb http://mirrors.163.com/ubuntu/ precise-backports main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ precise-backports main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ precise-security main restricted
deb-src http://mirrors.163.com/ubuntu/ precise-security main restricted
deb http://mirrors.163.com/ubuntu/ precise-security universe
deb-src http://mirrors.163.com/ubuntu/ precise-security universe
deb http://mirrors.163.com/ubuntu/ precise-security multiverse
deb-src http://mirrors.163.com/ubuntu/ precise-security multiverse
deb http://extras.ubuntu.com/ubuntu precise main
deb-src http://extras.ubuntu.com/ubuntu precise main
#sohu
deb http://mirrors.sohu.com/ubuntu/ precise main restricted
deb-src http://mirrors.sohu.com/ubuntu/ precise main restricted
deb http://mirrors.sohu.com/ubuntu/ precise-updates main restricted
deb-src http://mirrors.sohu.com/ubuntu/ precise-updates main restricted
deb http://mirrors.sohu.com/ubuntu/ precise universe
deb-src http://mirrors.sohu.com/ubuntu/ precise universe
deb http://mirrors.sohu.com/ubuntu/ precise-updates universe
deb-src http://mirrors.sohu.com/ubuntu/ precise-updates universe
deb http://mirrors.sohu.com/ubuntu/ precise multiverse
deb-src http://mirrors.sohu.com/ubuntu/ precise multiverse
deb http://mirrors.sohu.com/ubuntu/ precise-updates multiverse
deb-src http://mirrors.sohu.com/ubuntu/ precise-updates multiverse
deb http://mirrors.sohu.com/ubuntu/ precise-backports main restricted universe multiverse
deb-src http://mirrors.sohu.com/ubuntu/ precise-backports main restricted universe multiverse
deb http://mirrors.sohu.com/ubuntu/ precise-security main restricted
deb-src http://mirrors.sohu.com/ubuntu/ precise-security main restricted
deb http://mirrors.sohu.com/ubuntu/ precise-security universe
deb-src http://mirrors.sohu.com/ubuntu/ precise-security universe
deb http://mirrors.sohu.com/ubuntu/ precise-security multiverse
deb-src http://mirrors.sohu.com/ubuntu/ precise-security multiverse
deb http://extras.ubuntu.com/ubuntu precise main
deb-src http://extras.ubuntu.com/ubuntu precise main
#cn99
deb http://ubuntu.cn99.com/ubuntu/ precise main restricted universe multiverse
deb http://ubuntu.cn99.com/ubuntu/ precise-updates main restricted universe multiverse
deb http://ubuntu.cn99.com/ubuntu/ precise-security main restricted universe multiverse
deb http://ubuntu.cn99.com/ubuntu/ precise-backports main restricted universe multiverse
deb http://ubuntu.cn99.com/ubuntu-cn/ precise main restricted universe multiverse
#uestc
deb http://ubuntu.uestc.edu.cn/ubuntu/ precise main restricted universe multiverse
deb http://ubuntu.uestc.edu.cn/ubuntu/ precise-backports main restricted universe multiverse
deb http://ubuntu.uestc.edu.cn/ubuntu/ precise-proposed main restricted universe multiverse
deb http://ubuntu.uestc.edu.cn/ubuntu/ precise-security main restricted universe multiverse
deb http://ubuntu.uestc.edu.cn/ubuntu/ precise-updates main restricted universe multiverse
deb-src http://ubuntu.uestc.edu.cn/ubuntu/ precise main restricted universe multiverse
deb-src http://ubuntu.uestc.edu.cn/ubuntu/ precise-backports main restricted universe multiverse
deb-src http://ubuntu.uestc.edu.cn/ubuntu/ precise-proposed main restricted universe multiverse
deb-src http://ubuntu.uestc.edu.cn/ubuntu/ precise-security main restricted universe multiverse
deb-src http://ubuntu.uestc.edu.cn/ubuntu/ precise-updates main restricted universe multiverse
#ustc
deb http://debian.ustc.edu.cn/ubuntu/ precise main restricted universe multiverse
deb http://debian.ustc.edu.cn/ubuntu/ precise-backports restricted universe multiverse
deb http://debian.ustc.edu.cn/ubuntu/ precise-proposed main restricted universe multiverse
deb http://debian.ustc.edu.cn/ubuntu/ precise-security main restricted universe multiverse
deb http://debian.ustc.edu.cn/ubuntu/ precise-updates main restricted universe multiverse
deb-src http://debian.ustc.edu.cn/ubuntu/ precise main restricted universe multiverse
deb-src http://debian.ustc.edu.cn/ubuntu/ precise-backports main restricted universe multiverse
deb-src http://debian.ustc.edu.cn/ubuntu/ precise-proposed main restricted universe multiverse
deb-src http://debian.ustc.edu.cn/ubuntu/ precise-security main restricted universe multiverse
deb-src http://debian.ustc.edu.cn/ubuntu/ precise-updates main restricted universe multiverse
#bjtu
deb http://mirror.bjtu.edu.cn/ubuntu/ precise main multiverse restricted universe
deb http://mirror.bjtu.edu.cn/ubuntu/ precise-backports main multiverse restricted universe
deb http://mirror.bjtu.edu.cn/ubuntu/ precise-proposed main multiverse restricted universe
deb http://mirror.bjtu.edu.cn/ubuntu/ precise-security main multiverse restricted universe
deb http://mirror.bjtu.edu.cn/ubuntu/ precise-updates main multiverse restricted universe
deb-src http://mirror.bjtu.edu.cn/ubuntu/ precise main multiverse restricted universe
deb-src http://mirror.bjtu.edu.cn/ubuntu/ precise-backports main multiverse restricted universe
deb-src http://mirror.bjtu.edu.cn/ubuntu/ precise-proposed main multiverse restricted universe
deb-src http://mirror.bjtu.edu.cn/ubuntu/ precise-security main multiverse restricted universe
deb-src http://mirror.bjtu.edu.cn/ubuntu/ precise-updates main multiverse restricted universe
#lupaworld
deb http://mirror.lupaworld.com/ubuntu/ precise main universe restricted multiverse
deb-src http://mirror.lupaworld.com/ubuntu/ precise main universe restricted multiverse
deb http://mirror.lupaworld.com/ubuntu/ precise-security universe main multiverse restricted
deb-src http://mirror.lupaworld.com/ubuntu/ precise-security universe main multiverse restricted
deb http://mirror.lupaworld.com/ubuntu/ precise-updates universe main multiverse restricted
deb http://mirror.lupaworld.com/ubuntu/ precise-proposed universe main multiverse restricted
deb-src http://mirror.lupaworld.com/ubuntu/ precise-proposed universe main multiverse restricted
deb http://mirror.lupaworld.com/ubuntu/ precise-backports universe main multiverse restricted
deb-src http://mirror.lupaworld.com/ubuntu/ precise-backports universe main multiverse restricted
deb-src http://mirror.lupaworld.com/ubuntu/ precise-updates universe main multiverse restricte
EOF
apt-get update
}
update_debian_apt_source()
{
echo -e "\033[40;32mBackup the original configuration file,new name and path is /etc/apt/sources.list.back.\n\033[40;37m"
cp -fp /etc/apt/sources.list /etc/apt/sources.list.back
cat > /etc/apt/sources.list <<EOF
#163
deb http://mirrors.163.com/debian squeeze main contrib non-free
deb-src http://mirrors.163.com/debian squeeze main contrib non-free
#debian
deb http://security.debian.org/ squeeze/updates main contrib
deb-src http://security.debian.org/ squeeze/updates main contrib
deb http://ftp.debian.org/debian/ squeeze-updates main contrib
deb-src http://ftp.debian.org/debian/ squeeze-updates main contrib
#cdn
deb http://cdn.debian.net/debian/ squeeze main
deb-src http://cdn.debian.net/debian/ squeeze main
deb http://cdn.debian.net/debian/ squeeze-updates main contrib
deb-src http://cdn.debian.net/debian/ squeeze-updates main contrib
#sohu
deb http://mirrors.sohu.com/debian squeeze main contrib non-free
deb-src http://mirrors.sohu.com/debian squeeze main contrib non-free
#163 update
deb http://mirrors.163.com/debian squeeze-proposed-updates main contrib non-free
deb-src http://mirrors.163.com/debian squeeze-proposed-updates main contrib non-free
#queeze-backports
deb http://mirrors.163.com/debian-backports/ squeeze-backports main contrib non-free
deb-src http://mirrors.163.com/debian-backports/ squeeze-backports main contrib non-free
#sohu update
deb http://mirrors.sohu.com/debian squeeze-proposed-updates main contrib non-free
deb-src http://mirrors.sohu.com/debian squeeze-proposed-updates main contrib non-free
#sjtu
deb http://ftp.sjtu.edu.cn/debian/ squeeze main non-free contrib
deb http://ftp.sjtu.edu.cn/debian/ squeeze-proposed-updates main non-free contrib
deb http://ftp.sjtu.edu.cn/debian-security/ squeeze/updates main non-free contrib
EOF
apt-get update
}
rhel5_vnc_config()
{
cat >$vnc_xstartup_config<<EOF
#!/bin/sh
# Uncomment the following two lines for normal desktop:
# unset SESSION_MANAGER
# exec /etc/X11/xinit/xinitrc
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r \$HOME/.Xresources ] && xrdb \$HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
xterm -geometry 80x24+10+10 -ls -title "\$VNCDESKTOP Desktop" &
#twm &
gnome-session &
EOF
cat >$vnc_sysconfig_vncservers<<EOF
# 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
# <URL:http://www.uk.research.att.com/archive/vnc/sshvnc.html>.
# Use "-nolisten tcp" to prevent X connections to your VNC server via TCP.
# Use "-nohttpd" to prevent web-based VNC clients connecting.
# 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="2:myusername"
# VNCSERVERARGS[2]="-geometry 800x600 -nolisten tcp -nohttpd -localhost"
VNCSERVERS="1:root"
EOF
}
check_selinux_config()
{
if grep "SELINUX=enforcing" $selinux_config >/dev/null 2>&1
then
sed -i 's/SELINUX=enforcing/SELINUX=disabled/' $selinux_config
fi
}
centos5_install_vnc_server()
{
if [ "$1" == "redhat5" ]
then
if rpm -qa|grep redhat-logos >/dev/null 2>&1
then
yum remove $(rpm -qa|grep redhat-logos) -y
fi
fi
if yum grouplist "GNOME Desktop Environment"|grep "Available" >/dev/null 2>&1
then
if ! yum groupinstall "GNOME Desktop Environment" -y
then
exit_script "GNOME Desktop Environment"
fi
fi
if ! rpm -q vnc-server >/dev/null 2>&1
then
if ! yum install vnc-server -y
then
exit_script vnc-server
fi
vncserver <<EOF
$password
$password
EOF
else
vncpasswd <<EOF
$password
$password
EOF
fi
vncserver -kill :1
service vncserver stop
service pcscd stop
chkconfig --del pcscd
yum remove esc -y
rhel5_vnc_config
chmod 755 $vnc_xstartup_config
chkconfig --level 345 vncserver on
service NetworkManager stop
chkconfig --del NetworkManager
check_selinux_config
sleep 20
service vncserver start
}
centos6_install_vnc_server()
{
if yum grouplist "X Window System"|grep "Available" >/dev/null 2>&1
then
if ! yum groupinstall "X Window System" -y
then
exit_script "X Window System"
fi
fi
if yum grouplist "Desktop"|grep "Available" >/dev/null 2>&1
then
if ! yum groupinstall "Desktop" -y
then
exit_script Desktop
fi
fi
if yum grouplist "Chinese Support"|grep "Available" >/dev/null 2>&1
then
if ! yum groupinstall "Chinese Support" -y
then
exit_script "Chinese Support"
fi
fi
if ! rpm -q tigervnc-server >/dev/null 2>&1
then
if ! yum install tigervnc-server -y
then
exit_script tigervnc-server
fi
vncserver <<EOF
$password
$password
EOF
else
vncpasswd <<EOF
$password
$password
EOF
fi
vncserver -kill :1
service vncserver stop
service pcscd stop
chkconfig --del pcscd
yum remove esc -y
sed -i 's/.*!= root.*/#&/' /etc/pam.d/gdm
dbus-uuidgen >/var/lib/dbus/machine-id
rhel5_vnc_config
chmod 755 $vnc_xstartup_config
chkconfig --level 345 vncserver on
service NetworkManager stop
chkconfig --del NetworkManager
sleep 20
service vncserver start
check_selinux_config
}
ubuntu_install_vnc_server()
{
if ! dpkg -s lxde >/dev/null 2>&1
then
if ! apt-get install lxde -y --force-yes --fix-missing
then
exit_script lxde
fi
fi
if ! dpkg -s ttf-arphic-uming >/dev/null 2>&1
then
if ! apt-get install ttf-arphic-uming -y --force-yes --fix-missing
then
exit_script ttf-arphic-uming
fi
fi
if ! dpkg -s vnc4server >/dev/null 2>&1
then
if ! apt-get install vnc4server -y --force-yes --fix-missing
then
exit_script vnc4server
fi
vncserver <<EOF
$password
$password
EOF
else
vncpasswd <<EOF
$password
$password
EOF
fi
vncserver -kill :1
sed -i 's/x-window-manager \&/startlxde \&/' $vnc_xstartup_config
sed -i '/vncserver/d' $rc_local
sed -i 's/^exit 0$/su root \-c "\/usr\/bin\/vncserver \-name my-vnc-server \-geometry 1280x800 \:1"\nexit 0/' $rc_local
sleep 5
vncserver
}
####################Start###################
#check lock file ,one time only let the script run one time
LOCKfile=/tmp/.$(basename $0)
if [ -f "$LOCKfile" ]
then
echo -e "\033[1;40;31mThe script is already exist,please next time to run this script.\n\033[0m"
exit
else
echo -e "\033[40;32mStep 1.No lock file,begin to create lock file and continue.\n\033[40;37m"
touch $LOCKfile
fi
#check user
if [ $(id -u) != "0" ]
then
echo -e "\033[1;40;31mError: You must be root to run this script, please use root to install this script.\n\033[0m"
rm -f $LOCKfile
exit 1
fi
vnc_xstartup_config=/root/.vnc/xstartup
vnc_sysconfig_vncservers=/etc/sysconfig/vncservers
selinux_config=/etc/selinux/config
rc_local=/etc/rc.local
password=$(cat /dev/urandom | head -1 | md5sum | head -c 6)
echo -e "\033[40;32mStep 2.Begen to check the OS issue.\n\033[40;37m"
os_release=$(check_os_release)
if [ "X$os_release" == "X" ]
then
echo -e "\033[1;40;31mThe OS does not identify,So this script is not executede.\n\033[0m"
rm -f $LOCKfile
exit 0
else
echo -e "\033[40;32mThis OS is $os_release.\n\033[40;37m"
fi
echo -e "\033[40;32mStep 3.Begen to modify the source configration file and update.\n\033[40;37m"
case "$os_release" in
redhat5|centos5)
modify_rhel5_yum
;;
redhat6|centos6)
modify_rhel6_yum
;;
ubuntu10)
update_ubuntu10_apt_source
;;
ubuntu12)
update_ubuntu12_apt_source
;;
debian6)
update_debian_apt_source
;;
esac
echo -e "\033[40;32mStep 4.Begen to check and install vnc server.\n\033[40;37m"
case "$os_release" in
redhat5|centos5)
centos5_install_vnc_server $os_release
;;
redhat6|centos6)
centos6_install_vnc_server $os_release
;;
ubuntu10|ubuntu12|debian6)
ubuntu_install_vnc_server
;;
esac
echo -e "\033[40;32m.Install success.The vnc password is \"$password\",this script now exit!\n\033[40;37m"
rm -f $LOCKfile
VNC服务端自动化配置脚本的更多相关文章
- Windows安装VNC服务端
下载VNC服务端 由于服务器在IDC机房,只能使用系统自带远程桌面连接到服务器进行安装VPC服务端 但在安装过程发现,如果是通过远程桌面连接到服务器进行安装,VNC Mirror Driver会报错无 ...
- 【VNC】Linux环境VNC服务安装、配置与使用
[VNC]Linux环境VNC服务安装.配置与使用 2009-06-25 15:55:31 分类: Linux 前言:作为一名DBA,在创建Oracle数据库的过程中一般要使用dbca和netc ...
- SSR服务端一键安装脚本
支持新协议混淆,SSR服务端一键安装脚本 Shadowsocks-R 是项目 shadowsocks 的增强版,用于方便地产生各种协议接口.实现为在原来的协议外套一层编码和解码接口,不但可以伪装成 ...
- centos 7安装vnc服务端&vnc客户端连接
前言 工作需求,需要用到vnc,介绍一下相关内容. 安装vnc服务端 在执行其他相关的之前,需要先安装一下vnc的服务端,命令如下: yum install tigervnc-server 配置vnc ...
- 03-openldap服务端安装配置
openldap服务端安装配置 阅读目录 基础环境准备 安装openldap服务端 初始化openldap配置 启动OpenLDAP 重新生成配置文件信息 规划OpenLDAP目录树组织架构 使用GU ...
- Linux : Vim 使用与配置 (附 GitHub 自动化配置脚本)
由于经常使用 vim 编辑配置文件,有时候也会进行使用vim 编写一些脚本和c/c++ 程序,所以配置一个常用的 vim 是很是必要的.这篇博文主要是记录vim使用和配置相关的一些知识点. 关于vim ...
- NFS相关、NFS服务端安装配置、exportfs命令、nfs客户端的问题
1.NFS (network file system,基于RPC协议) 2.NFS服务端安装配置安装服务端:yum install nfs-utils rpcbind -y安装客户端:yum inst ...
- NFS介绍 NFS服务端安装配置 NFS配置选项
NFS 介绍 • NFS是Network File System的缩写 • NFS最早由Sun公司开发,分2,,4三个版本,2和3由Sun起草开发,.0开始Netapp公司参与并主导开发,最新为4.1 ...
- NFS介绍、服务端安装配置、NFS配置选项
6月21日任务 14.1 NFS介绍14.2 NFS服务端安装配置14.3 NFS配置选项 14.1 NFS介绍 14.2 NFS服务端安装配置 1.首先需要2台机器,一台是服务端,一台是客户端,分别 ...
随机推荐
- ping命令找不到
重装系统后安装JDK了,网络一直不好,我ping了下,结果显示ping不是内部或者外部命令,在谷歌里百度了下,在环境变量的path后加上“;C:\Windows\System32”即可,果然有效哦. ...
- hibernate的速度问题--hibernate.jdbc.fetch_size和 hibernate.jdbc.batch_size
hibernate的速度问题 这点我也疑惑过,最初应用hibernate的项目,我也感觉速度很慢,知道后来才知道问题的所在. 其实hibernate的速度性能并不差,比起jdbc来说,又是 ...
- TCP/IP 邮件的原理
邮件通过SMTP协议来实现,有它的服务器SMTP服务器. 它是怎么在万维网中运行的呢? 我们来看看两个案例,下面的两个图来展示. 案例一: Alice通过传统的邮件服务器发送给Bob,Bob通过HTT ...
- mysql 累加排序求名次
自己做的一个小项目里需要用mysql计算一些信息. mysql中的 表如下(注:表中数据都是测试数据,随机生成的) mysql> select * from shake_log; +-----+ ...
- Light OJ 1038 - Race to 1 Again(概率DP)
题目的意思是说任何一个大于1的整数,经过若干次除以自己的因子之后可以变为1, 求该变换字数的数学期望值. 题目分析: 我们设置dp[n] 为数字n的期望.假设n的因子为k1, k2, k3.... ...
- Delphi 6 Web Services初步评估之三(转)
Delphi 6 Web Services初步评估之三(转) Delphi 6 Web Services初步评估之三(转)★ 测试总体印象:在整个测试中,对Delphi 6创建的Web Servi ...
- HDOJ/HDU 1865 1sting(斐波拉契+大数~)
Problem Description You will be given a string which only contains '1'; You can merge two adjacent ' ...
- mac上的键盘生活——输入法键位设置小技巧以及去掉自带输入法
今天上QQ跟阳小进讨论的时候突然聊到了输入法,然后阳小进就发了这样一段文字过来: 修改中西文切换键由Shift到Ctrl 关于为什么要改为Ctrl键,贴吧里有个讨论 在贴吧说服佛振的网友: 「因为 S ...
- mac上的键盘生活——quicksliver
昨天晚上一直在找mac上的博客客户端,没发现很好的国内支持客户端,却发现了一个新的东西--quicksliver 简单的说,这个就是个快捷键启动方式,这是我在mac上用的最好的一个快捷键启动程序( ...
- Axure初体验:简单交互、通过按钮切换图片
前言: 之前是一直用processon的UI原型设计,后来感觉只能完成静态页面的processon满足不了原型设计的需求,断网时候也不方便修改.展示.最终还是决定学习动态页面的制作,所选工具为原型设计 ...