本来是写的Word文档,给其他国家的同时看的,所以一开始就是英文写的,也没打算翻译成为中文了,顺便抱怨下,网上资料找了很久的资料都没有看到介绍怎么在单机环境下搭建RD Gateway的,写本文的目的是给公司的同事介绍下怎么搭建一台跳转机来做远程登录,同时希望可以帮到有需要的人。

在AWS的VPC中,我们是把所有的服务器都独立于外部的,不允许外部直接进行访问,所以如果要远程登录到VPC里面的服务器,是需要通过一台跳转服务器来进行远程登录的。这里在Windows的环境下是通过RD Gateway over SSL 的方式搭建的。本人已经测试过了,可以正常使用。

由于个人比较偷懒,不想在Blog中进行编辑了,所以原始文档中的图片就都没法插入到博客中了,下面在每个具体的任务中的数字排序也有点乱了。但是如果你要看的话,就是按照顺序看下就好了,操作步骤也是一步一步操作的。基本上文字描述大家都比较清楚。如果你有什么问题不明白的可以留言问我。

Create jump box

Request a server from AWS

  1. Select an AMI, here we select the windows server 2012 R2 Base
  1. Select t2.small as instance type
  2. In the step of ‘Configure Instance’, follow by:

Network: the VPC you just created

Subnet: select the public subnet

Auto-Assign public IP: Enable

Others by default.

  1. Default 30G size is ok in the step of ‘Add Storage’
  2. In the ‘Add Tags’ step, please specify the name: Group(your number)-JumperBox
  3. In the step of ‘Configure Security Group’, we create a new security group here, and allow the port of 3389, 443 to access by everyone(in the real case, 3389 only for administrator’s IP access)
  1. When you click the ‘Launch’ button, it will ask you to select a key pairs, please create a new one here, and for the coming EC2 request, you should use the same key pairs file.
  1. Go back to Instance page, and find the EC2 server you just created, find the IP, then prepare to remote to this server(please note you have to switch to non-Merck network environment to remote this server)
  1. Click this server, and from the Actions menu to get this server’s password, here you need to upload the key pairs file to get the password
  1. Open your compute, start->run->input ‘mstsc /f’ command. Input username and password. Then login to the server.
  2. Copy the certificate generation tool from sharefoler to a place you want to save.
  3. Open your cmd window, locate into the tool folder:

Create the certificate

  1. Create a self-sign root cert(issuer):

makecert -n "CN=yourpublicip" -r  -eku 1.3.6.1.5.5.7.3.1 -sv yourpublicip.pvk yourpublicip.cer

 

input the password, for testing purpose, you can just input 1

  1. Convert the pvk file to pfx file, execute the bellow two commands one bye one, input password 1 in the second command.

cert2spc yourpublicip.cer yourpublicip.spc

pvk2pfx -pvk yourpublickip.pvk -spc yourpublicip.spc -pfx youpublicip.pfx

 

Now the pfx file is created.

  1. So far, we have one .cer file, and one .pfx file. we will use the two files later
  2. Click Server Manager->on the Dashboard->Add roles and features
  3. Select Role-based or feature-based installation

Install the Remote Desktop Services

  1. Select the current server
  1. In the server roles, select Remote Desktop Services
  1. In the role services, select Remote Desktop Gateway, it will prompt a window to ask you add related features, please add all.
  1. In the Network Policy And Access Services, please select the Network Policy Server
  1. In the Web Server Role(IIS), except for the default selection, please add one more: ASP.NET 4.5.
  1. Click install and wait it till to complete.
  2. You will see the components like below screenshot if you installed successfully
  3. In the administrative tools, open the internet information services(IIS) manager.
  4. click the computer name node:
  5. locate into the Server Certificates which is on the right pane under IIS section, double click it

Configure the RD Gateway over SSL

  1. in the Actions pane, click Import… link, it will ask you provide the .pfx file
  1. Browse the .pfx file you saved in the last step. And password should be empty, click OK button
  1. Locate into the Default Web Site node
  1. In the right pane, click Bindings… link
  1. Add 443 port, and select the cert you just upload. Then click OK button.
  1. Go back to the administrative tools, click Remote Desktop Gateway Manager
  1. Under the policies, select the Connection Authorization Policies, and Create New Policy
  1. Using the wizard
  1. Input the name
  1. Add who can connect this RD gateway, here we let all users who are in the builtin\users group
  1. Keep default in the Device Redirection secton
  1. Session timeout, enable session timeout
  1. Click next till to finish.
  2. Follow the above same step, create another policy 2, in this policy, we allow the administrators group user can connect the RD Gateway
  3. Now you have created two policies as bellow:
  1. Let’s start to create RAP now
  1. Add the users group
  1. Allow users to connect to any network resource(computer)
  1. Allow connections only to port 3389
  1. Click finish, and the same, create another RAP policy for administrators, then you can see the bellow screenshot
  1. We are almost done, last we need to configure the SSL for the RD Gateway, locate into computer node, right click and select properties
  1. Click the SSL Certificate tab, and select Import a certificate…
  1. Browse and import certificate which you just save at the before step.
  1. Empty password, click OK button to show the bellow alert.
  1. Uncheck the UDP Transport Settings in the Transport Settings tab
  2. Click Apply and close this window
  3. Restart the RD Gateway services.

Create a user in server

  1. Create a user
  1. Password never expires
  1. Make sure this user only in the Users group.

Install certificate on your personal computer

  1. Copy the .cer file from server to your laptop
  2. Double click the cert
  3. Click Install Certificate… button
  1. Choose the ‘Trusted Root Certification Authorities’ as the certificate store.
  1. Click Next ,when you click finish button, it will have alter window, please click Yes button
  2. To verify the cert if is ok, open your IE, and input https://yourpublicip , if there is no warning page, then it turns out you are in the right status.

Start remote desktop connection from your computer

  1. In the advanced tab, click Settings…
  2. Select ‘Use these RD Gateway server settings’
  3. Input the server IP
  4. Check the Bypass RD Gateway….
  5. Uncheck ‘Use my RD Gateway…’
  6. Save the file, and click to connect
  7. Firstly, it will ask you to input the credential of the RD Gateway user name and password, if pass, then it will ask you to input the target server credentials.

How to create a jump server in AWS VPC的更多相关文章

  1. Jump Server在docker中安装部署

    安装部署: 1.准备机器: 官方环境要求: 硬件配置: 2个CPU核心, 4G 内存, 50G 硬盘(最低) 操作系统: Linux 发行版 x86_64 Python = 3.6.x Mysql S ...

  2. Create a SQL Server Database on a network shared drive

    (原文地址:http://blogs.msdn.com/b/varund/archive/2010/09/02/create-a-sql-server-database-on-a-network-sh ...

  3. How to create a PPPoE Server on Ubuntu? (Untested)

    How to create a PPPoE Server on Ubuntu? March 30, 2011 coder_commenter Leave a comment Go to comment ...

  4. [转]How to: Create a Report Server Database (Reporting Services Configuration)

    本文转自:https://docs.microsoft.com/en-us/previous-versions/sql/sql-server-2008-r2/ms157300%28v%3dsql.10 ...

  5. 报错:Cannot create PoolableConnectionFactory (The server time zone value 'CST' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverT

    报错:Cannot create PoolableConnectionFactory (The server time zone value 'CST' is unrecognized or repr ...

  6. how to create a flask server

    1. use database 2. use redis 3. inport/export excel2007 version+ from flask import send_from_directo ...

  7. (转)Genymotion安装virtual device的“unable to create virtual device, Server returned Http status code 0”的解决方法

    网络原因无法下载virtual device,status 为0表示服务器没有响应.FQ下载吧,有VPN的小伙伴推荐这种. 或者直接手动下载ova虚拟机文件,然后将虚拟机文件导入到virtualbox ...

  8. Genymotion加入模拟器时报“Unable to create virtual device,Server returned HTTP status code 0”

    今天也遇到这个问题,算是对这个文章的一点补充 打开图中这个文件 C:\Users\xxx\AppData\Local\Genymobile 搜索 [downloadFile] 找到这个一串URL ht ...

  9. aws vpc 知识总结(助理级)

    一 什么是vpc? Amazon Virtual Private Cloud(Amazon VPC)使您可以将AWS资源启动到您定义的虚拟网络中. 虚拟的云计算. /* 1 默认vpc ? 创建一个具 ...

随机推荐

  1. Api接口通用安全策略及实现-OSS.Core

    这篇文章一直说写,迟迟没有动手,这两天看到一些应用接口数据被别人爬虫.短信接口被人高频率请求攻击等案列,感觉简单概述分享一下接口安全验证还是有必要的.毕竟当下基本都以客户端应用为主,如果前期疏忽,发布 ...

  2. js判断一个数组是否为空

    var s = []; if(s.length == 0){ alert('空数组'); }

  3. [leetcode-557-Reverse Words in a String III]

    Given a string, you need to reverse the order of characters in each word within a sentence whilestil ...

  4. 机器学习之分类问题实战(基于UCI Bank Marketing Dataset)

    导读: 分类问题是机器学习应用中的常见问题,而二分类问题是其中的典型,例如垃圾邮件的识别.本文基于UCI机器学习数据库中的银行营销数据集,从对数据集进行探索,数据预处理和特征工程,到学习模型的评估与选 ...

  5. PHP基础入门(五)---PHP面向对象

    前言: 今天来和大家介绍一下PHP的面向对象.说到面向对象,我不得不提一下面向过程,因为本人在初学时,常常分不清楚. 那么面向对象和面向过程有什么区别呢?下面给大家简单介绍一下: 面向对象专注于由哪个 ...

  6. Vijos 1034 家族 并查集

    描述 若某个家族人员过于庞大,要判断两个是否是亲戚,确实还很不容易,现在给出某个亲戚关系图,求任意给出的两个人是否具有亲戚关系. 规定:x和y是亲戚,y和z是亲戚,那么x和z也是亲戚.如果x,y是亲戚 ...

  7. 使用hexdump工具追踪EXT4文件系统中的一个文件

    昨天追踪EXT4文件系统的过程中出了点问题,就是找不到文件,于是试了一下追踪FAT32文件系统的,成功之后有了点信心,今天继续嗑EXT4文件系统,终于找到啦,记录一下. 操作系统:linux(cent ...

  8. VB6之摄像头控制

    参考文献:http://www.cnblogs.com/xidongs/archive////.html 直接上代码: 'code by lichmama from cnblogs.com '@vb6 ...

  9. 阿里云服务器 Windows连接不成功 提示“你的凭证不工作” 解决方法

    HKEY_LOCAL_MACHINE -> SYSTEM -> CurrentControlSet -> Control ->Terminal Server -> Wds ...

  10. 【ALB学习笔记】基于事件触发方式的串行通信接口数据接收案例

    基于事件触发方式的串行通信接口数据接收案例 广东职业技术学院  欧浩源 一.案例背景 之前写过一篇<基于多线程方式的串行通信接口数据接收案例>的博文,讨论了采用轮询方式接收串口数据的情况. ...