创新路
我们一直在努力

阿里云-搭建属于自己的windows激活服务器(KMS)

如题,本文中所有操作都在阿里云服务器centos7.6系统下进行

首先在阿里云申请到一个免费的云服务器,系统选用centos7.6。

接着输命令下载搭建kms的脚本文件

wget https://raw.githubusercontent.com/dakkidaze/one-key-kms/master/one-key-kms-centos.sh

这个地址指向一个脚本文件one-key-kms-centos.sh。内容如下(能力有限只做部分注释)

*

#! /bin/bash

#One-key-kms script by Dakkidaze <gioku@docomo.net.cn>

PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin    配置环境变量
export PATH                                                                                                 环境变量生效
clear
start(){
yum install gcc git make -y                                                                    安装并编译gcc和git源码程序
mkdir /usr/local/kms                                                    
cd /usr/local/kms                                                       
git clone  https://github.com/Wind4/vlmcsd.git                                  远程克隆代码库                                                     
cd vlmcsd                                                                                              进入此目录
make                                                                                                     编译
cd bin
mv vlmcsd /usr/local/kms/kms                                            
cd /usr/local/kms/                                                     
rm -rf ./vlmcsd/                                                        
mv kms vlmcsd
clear  
echo "Succeeded."                                                                             以下为输出和判断语句
echo "The executable file lies in /usr/local/kms/"
echo "Remember that the server is not running right now."
echo "Please use -h to find possible usage for the executable or visit vlmcsd on Github."
echo "https://github.com/Wind4/vlmcsd"
echo "Addtionally, you may want to get a script to manage it."
echo "In this case, you may download a script at the one-key-kms repository."
echo "Thanks for your using!"
echo "Dakkidaze <gioku@docomo.net.cn>"
}
echo "This script will automatically download and compile KMS Server program for you."
echo "For more information, please visit https://github.com/Wind4/vlmcsd"
echo "Scrpit written by Dakkidaze <gioku@docomo.net.cn>"
echo "READY TO START?"
read -p "y/n:" choice
case $choice in
    "y")
    start
    ;;
    "n")
    exit 0;
    ;;
    *)
    echo "Please enter y or n!"
    ;;
esac

*

将脚本文件下载下来之后使用chmod +x one-key-kms-centos.sh将其可执行权限开放

最后执行此脚本./one-key-kms-centos.sh。脚本效果如上所述,如果想知道远程代码仓库内容可自行输入网址查看

kms搭建好后用三条命令启动分别为:

wget https://raw.githubusercontent.com/dakkidaze/one-key-kms/master/kms.sh
chmod +x kms.sh
./kms.sh start

此时搭建完成,记住检查端口是否开放,如图

图片.png

别问我问什么是1688,我也不知道,现在可以去电脑上测试激活是否成功了,创建如图所示bat文件,图中IP为我的云服务器公网ip

图片.png

端口号可加可不加,命令含义就不多说了,直接上结果图

图片.png

居然失败了?这个问题困扰我好几个小时,为什么不能连接上我的云服务器,尝试ping云服务器公网IP也是通的,只能是端口问题,系统显示我的1688端口也正常listen状态。wyh?

最后我终于在阿里云控制台管理找到答案,见图

图片.png

图片.png

在安全组配置中我看到了熟悉的端口22,这不就是我远程建立ssh连接时用的端口吗,目测在这个地方时需要添加端口的,于是我依葫芦画瓢,添加了1688端口的规则,这次终于出现了

图片.png

图片.png

终于圆满解决,累了累了

客官点个赞呗! (0)
分享到:

评论 抢沙发

评论前必须登录!

天府云博 - 做有态度的开发&运维&设计学习分享平台!

联系我们百度云主机