How to create a jump server in AWS VPC
本来是写的Word文档,给其他国家的同时看的,所以一开始就是英文写的,也没打算翻译成为中文了,顺便抱怨下,网上资料找了很久的资料都没有看到介绍怎么在单机环境下搭建RD Gateway的,写本文的目的是给公司的同事介绍下怎么搭建一台跳转机来做远程登录,同时希望可以帮到有需要的人。
在AWS的VPC中,我们是把所有的服务器都独立于外部的,不允许外部直接进行访问,所以如果要远程登录到VPC里面的服务器,是需要通过一台跳转服务器来进行远程登录的。这里在Windows的环境下是通过RD Gateway over SSL 的方式搭建的。本人已经测试过了,可以正常使用。
由于个人比较偷懒,不想在Blog中进行编辑了,所以原始文档中的图片就都没法插入到博客中了,下面在每个具体的任务中的数字排序也有点乱了。但是如果你要看的话,就是按照顺序看下就好了,操作步骤也是一步一步操作的。基本上文字描述大家都比较清楚。如果你有什么问题不明白的可以留言问我。
Create jump box
Request a server from AWS
- Select an AMI, here we select the windows server 2012 R2 Base
- Select t2.small as instance type
- 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.
- Default 30G size is ok in the step of ‘Add Storage’
- In the ‘Add Tags’ step, please specify the name: Group(your number)-JumperBox
- 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)
- 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.
- 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)
- 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
- Open your compute, start->run->input ‘mstsc /f’ command. Input username and password. Then login to the server.
- Copy the certificate generation tool from sharefoler to a place you want to save.
- Open your cmd window, locate into the tool folder:
Create the certificate
- 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
- 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.
- So far, we have one .cer file, and one .pfx file. we will use the two files later
- Click Server Manager->on the Dashboard->Add roles and features
- Select Role-based or feature-based installation
Install the Remote Desktop Services
- Select the current server
- In the server roles, select Remote Desktop Services
- In the role services, select Remote Desktop Gateway, it will prompt a window to ask you add related features, please add all.
- In the Network Policy And Access Services, please select the Network Policy Server
- In the Web Server Role(IIS), except for the default selection, please add one more: ASP.NET 4.5.
- Click install and wait it till to complete.
- You will see the components like below screenshot if you installed successfully
- In the administrative tools, open the internet information services(IIS) manager.
- click the computer name node:
- locate into the Server Certificates which is on the right pane under IIS section, double click it
Configure the RD Gateway over SSL
- in the Actions pane, click Import… link, it will ask you provide the .pfx file
- Browse the .pfx file you saved in the last step. And password should be empty, click OK button
- Locate into the Default Web Site node
- In the right pane, click Bindings… link
- Add 443 port, and select the cert you just upload. Then click OK button.
- Go back to the administrative tools, click Remote Desktop Gateway Manager
- Under the policies, select the Connection Authorization Policies, and Create New Policy
- Using the wizard
- Input the name
- Add who can connect this RD gateway, here we let all users who are in the builtin\users group
- Keep default in the Device Redirection secton
- Session timeout, enable session timeout
- Click next till to finish.
- Follow the above same step, create another policy 2, in this policy, we allow the administrators group user can connect the RD Gateway
- Now you have created two policies as bellow:
- Let’s start to create RAP now
- Add the users group
- Allow users to connect to any network resource(computer)
- Allow connections only to port 3389
- Click finish, and the same, create another RAP policy for administrators, then you can see the bellow screenshot
- We are almost done, last we need to configure the SSL for the RD Gateway, locate into computer node, right click and select properties
- Click the SSL Certificate tab, and select Import a certificate…
- Browse and import certificate which you just save at the before step.
- Empty password, click OK button to show the bellow alert.
- Uncheck the UDP Transport Settings in the Transport Settings tab
- Click Apply and close this window
- Restart the RD Gateway services.
Create a user in server
- Create a user
- Password never expires
- Make sure this user only in the Users group.
Install certificate on your personal computer
- Copy the .cer file from server to your laptop
- Double click the cert
- Click Install Certificate… button
- Choose the ‘Trusted Root Certification Authorities’ as the certificate store.
- Click Next ,when you click finish button, it will have alter window, please click Yes button
- 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
- In the advanced tab, click Settings…
- Select ‘Use these RD Gateway server settings’
- Input the server IP
- Check the Bypass RD Gateway….
- Uncheck ‘Use my RD Gateway…’
- Save the file, and click to connect
- 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的更多相关文章
- Jump Server在docker中安装部署
安装部署: 1.准备机器: 官方环境要求: 硬件配置: 2个CPU核心, 4G 内存, 50G 硬盘(最低) 操作系统: Linux 发行版 x86_64 Python = 3.6.x Mysql S ...
- 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 ...
- 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 ...
- [转]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 ...
- 报错: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 ...
- how to create a flask server
1. use database 2. use redis 3. inport/export excel2007 version+ from flask import send_from_directo ...
- (转)Genymotion安装virtual device的“unable to create virtual device, Server returned Http status code 0”的解决方法
网络原因无法下载virtual device,status 为0表示服务器没有响应.FQ下载吧,有VPN的小伙伴推荐这种. 或者直接手动下载ova虚拟机文件,然后将虚拟机文件导入到virtualbox ...
- Genymotion加入模拟器时报“Unable to create virtual device,Server returned HTTP status code 0”
今天也遇到这个问题,算是对这个文章的一点补充 打开图中这个文件 C:\Users\xxx\AppData\Local\Genymobile 搜索 [downloadFile] 找到这个一串URL ht ...
- aws vpc 知识总结(助理级)
一 什么是vpc? Amazon Virtual Private Cloud(Amazon VPC)使您可以将AWS资源启动到您定义的虚拟网络中. 虚拟的云计算. /* 1 默认vpc ? 创建一个具 ...
随机推荐
- js中的匿名函数自执行
随笔,java中因为有修饰符的存在,那就有private类的存在,js不一样,没有修饰词一说,因此为了防止全局变量的污染,js中就出现了匿名函数,直接上code,看到的人可以自己体会: (functi ...
- 正则表达式去除字符串左右空格函数 调用方法是,str.Trim();
正则表达式去除字符串左右空格函数 调用方法是,str.Trim(); String.prototype.Trim = function() { return this.replace(/(^\s*)| ...
- Redis的安装与使用(单节点)
IP:192.168.4.111 环境:CentOS 6.6 Redis版本:redis-3.0 (考虑到Redis3.0在集群和性能提升方面的特性,rc版为正式版的候选版,而且很快就出正式版) 安装 ...
- 执行3小时超长SQL的分析优化过程:从索引遇见IS NULL,到最佳实践
月底高峰期,对一个典型项目抽查分析时,发现了一个超级慢.全表扫描的SQL,语句很简单,AWR中赫然在列,在我统计的截止时间内还没有结束... 使用v$active_session_history进一步 ...
- 在vs2010中显示代码的行数
1.打开VS2010,然后"工具" → "选项" 2.在选项页面,点击"文本编辑器"→"所有语言",在显示里将[行号]选 ...
- java环境配置,试用和基本数据结构
一.java环境配置 1.打开我的电脑--属性--高级--环境变量 2.新建系统变量JAVA_HOME 和CLASSPATH 变量名:JAVA_HOME 变量值:jdk文件所在的路经变量名:CLASS ...
- HashMap源码浅析(jdk1.8)
HashMap是以key-value键值对的形式进行存储数据的,数据结构是以数组+链表或红黑树实现. 数据结构图如下: 一.关键属性 HashMap初始化和方法使用的属性. /** * 默认初始容量1 ...
- 【亲测】自动构建多个指定的class并发执行:Jenkins+Maven+Testng框架
要解决的问题:jenkins在自动构建maven项目时如何并发执行多个指定的class类 预置条件:testngXXX.xml文件已指定了多个class类 解决步骤:1.在maven项目中新建指定te ...
- 移动端em与rem区别
rem与em都是相对单位,我们使用它们的目的就是为了适应各种手机屏幕. rem是根据html根节点来计算的,而em是继承父元素的字体.比如下面一个demo <!doctype html> ...
- nyoj_61: 传纸条(一)
题目链接 使用双线dp,假设两个人同时从左上角移动到右下角,且满足路线不交叉,另k=x1+y1=x2+y2压缩状态进行优化.每次状态转移满足 x1,x2,y1,y2都在矩阵范围内,且(x2,y2)在相 ...