-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlessons.html
162 lines (161 loc) · 11.4 KB
/
lessons.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
<div class="container" style="padding-top: 30px; ">
<div class="row">
<div class="col-md-12">
<h2>Lessons</h2>
</div>
</div>
<div class="row">
<div class="col-md-2">
<div class="list-group" id="list-tab" role="tablist">
<a class="list-group-item list-group-item-action active" id="lesson0-list" data-toggle="list" href="#lesson0" role="tab">Lesson 0</a>
<a class="list-group-item list-group-item-action" id="lesson1-list" data-toggle="list" href="#lesson1" role="tab" >Lesson 1</a>
<a class="list-group-item list-group-item-action" id="lesson1-list" data-toggle="list" href="#lesson2" role="tab" >Lesson 2</a>
<a class="list-group-item list-group-item-action" id="lesson1-list" data-toggle="list" href="#lesson3" role="tab" >Lesson 3</a>
<a class="list-group-item list-group-item-action" id="lesson1-list" data-toggle="list" href="#lesson4" role="tab" >Lesson 4</a>
</div>
</div>
<div class="col-md-10" style="overflow-y:scroll; max-height:500px">
<div class="tab-content" id="nav-tabContent">
<div class="tab-pane fade show active" id="lesson0" role="tabpanel">
<div class="jumbotron">
<div class="container" >
<h1 class="display-4">Lesson 0: Installing Prerequisite Software</h1>
<p class="lead">Tags: <span class="badge badge-info">Windows</span> <span class="badge badge-primary">Installation</span></p>
<p class="lead">Estimated time: 20 minutes</p>
<p class="lead">Difficulty: Easy</p>
<p class="lead">Operating Systems: Windows 7 and Up</p>
<p class="lead">Tools Used: <code>cmd.exe</code></p>
<hr>
<h3> Preparation </h3>
<ol>
<li> We will start by downloading the three applications <code>Project BrightSun</code> needs to work. Go to the download pages for <a href="https://www.virtualbox.org/wiki/Downloads">VirtualBox</a>, <a href="https://www.vagrantup.com/downloads.html">Vagrant</a>, and <a href="https://www.packer.io/downloads.html">Packer</a>.
Download the VirtualBox and Vagrant installers. For Packer, you should download a <code>.zip</code> file. Open the file and extract <code>packer.exe</code> to a directory you can remember.</li></br>
<li> Run the VirtualBox installer and then the Vagrant installer. After both installers have finished executing, restart your computer.
<div class="alert alert-danger" role="alert">
Note: if you have multiple drives on your computer, ensure <code>VirtualBox</code> is installed in the same directory as <code>Project BrightSun</code>. Otherwise, you will get errors when trying to build new machines.
</div> </li>
<li> Packer doesn't have an installer: <code>packer.exe</code> is the application itself. As such, we need to move it to the "Program Files" directory and then tell Windows where it is so that <code>packer</code> can be accessed from the command line. We're going to do all of this from the Windows command line in order to learn <code>cmd.exe</code> basics.
</br></br>
Open an Administrator session of command prompt. This can be done by navigating to "C:\Windows\System32". Scroll down until you find <code>cmd.exe</code>, right-click, and select "Run as administrator".
</br><img src="res/lessons/lesson0/cmd-admin.png" class="img-fluid" alt="Responsive image"></br>
We are now going to make a directory within "Program Files" for packer. Type <code>mkdir "C:\\Program Files"\packer</code> and click enter. "mkdir" tells command prompt to make a directory at the path we specified. We now need to move <code>packer.exe</code> to the directory we made. This can be done by typing <code>copy PATH/TO/PACKER.EXE "C:\\Program Files"\\packer.exe</code> into the command prompt. The "copy" command will a move a file from the first filepath specified to the second filepath. In the example shown below, you can see that I copied <code>packer.exe</code> from my Downloads directory to the packer folder we made earlier.
</br></br>
Finally, we need to add <code>packer.exe</code> to something called the "Path". In Windows, when a command is run from the command prompt, the "Path" is searched for files and directories that could contain the command. "Project BrightSun" needs to be able to call packer from command prompt, so it needs to be added to the Path. This can be done by typing <code>setx PATH "%PATH%;PATH/TO/PACKER/DIRECTORY/</code>. This command is a little complicated. <code>setx</code> allows you to set system variables such as PATH permanently. The second parameter it takes in is the variable we are setting, the PATH in this case. The third parameter is what we are setting it to.
Surrounding PATH with percentage signs (<code>%PATH%</code>) in the third parameter inserts the current path. From there, we add a new PATH variable called <code>PATH/TO/PACKER/DIRECTORY/</code>. Note that it's a path to the <i>directory</i>, NOT to <code>packer.exe</code>. An example of all the commands can be seen below.
</br><img src="res/lessons/lesson0/commands.png" class="img-fluid" alt="Responsive image"></br></br>
<div class="alert alert-info" role="alert">
Note: Adding the packer directory to the PATH can be done through the Windows GUI. On Windows 10, this can be done by going to "Advanced System Settings" and navigating to the "Environment Variables".
</div>
</li>
<li> Now, we should verify that everything was installed correctly. VirtualBox can be tested by just searching your computer for the application and launching it. Vagrant and packer can both be tested by typing their names in command prompt. If they were properly installed, you should see an output telling you about possible commands.
</br><img src="res/lessons/lesson0/verify.png" class="img-fluid" alt="Responsive image"></br>
</li>
</ol>
</div>
</div>
</div>
<div class="tab-pane fade" id="lesson1" role="tabpanel">
<div class="jumbotron">
<div class="container">
<h1 class="display-4">Lesson 1: Creating your first Domain Controller (DC)</h1>
<p class="lead">Tags: <span class="badge badge-info">Windows</span> <span class="badge badge-primary">Active Directory</span></p>
<p class="lead">Estimated time: 1 hour</p>
<p class="lead">Difficulty: Easy</p>
<p class="lead">Operating Systems: Windows Server 2008 R2 Server Core</p>
<p class="lead">Tools Used: <code>cmd.exe</code>, <kbd>netsh</kbd>, <kbd>dism</kbd>, <kbd>dcpromo</kbd>, and <kbd>dsquery/mod</kbd></p>
<hr>
<h3>Basic Setup:</h3>
<ol>
<li>Go to the <a href="config.html">Config page</a> and add two machines with the following settings:</li>
<dl>
<dt>dc1</dt>
<dd>Platform: Windows, Operating System: windows_server_2008_r2</dd>
<dt>workstation1</dt>
<dd>Platform: Windows, Operating System: windows_7</dd>
</dl>
<li>Download and extract the <code>.zip</code> file. Launch an Administrator Powershell prompt and navigate to the folder you unzipped it to.</li>
<li>Run <kbd>.\build.ps1</kbd> in order to build the boxes. This will take ~40 minutes depending on your computer and internet connection.</li>
<li>Once both machines have been added to VirtualBox, edit their Network Settings to be the following:</li>
<img src="res/lessons/lesson1/VirtualBoxSettings.png" class="img-fluid" alt="Responsive image">
<p></p>
<div class="alert alert-info" role="alert">
Note: Selecting <code>Internal Network</code> will place all machines on their own isolated virtual LAN network, but still allow them to communicate with each other.
</div>
<div class="alert alert-danger" role="alert">
Note: If you would like the Virtual Machines to also have Internet (not required), you will need to add another Network Adapter for <code>NAT</code> or <code>Bridged</code>.
</div>
<li>Turn on both Virtual Machines, and proceed through the installation proceedure. For the Server 2008 R2 machine, be sure to select <code>Windows Server 2008 R2 Enterprise (Server Core Edition)</code> when prompted for which Windows version to install.
</ol>
<h3>Setting up the Domain Controller:</h3>
<ol>
<li>Once the machine boots and you log in, you should see only a Windows Command Prompt. That is normal! Server Core is a stripped down version of the regular Windows Server, and it only has a command line interface.</li>
<li>Create new Active Directory Domain and DNS Server:</li>
<pre><kbd>dism /online /enable-feature /featurename:"NetFx2-ServerCore"
dism /online /enable-feature /featurename:"NetFx3-ServerCore"
dism /online /enable-feature /featurename:"DirectoryServices-DomainController-ServerFoundation"
dism /online /enable-feature /featurename:"DirectoryServices-ADAM-ServerCore"
dcpromo /ReplicaOrNewDomain:domain /Sitename:ad-jambajuice-com /InstallDNS:yes /NewDomain:forest /NewDomainDNSName:jambajuice.com /SafeModeAdminPassword:Chiapet1</kbd></pre>
<li>Promote the Computer to DC:</li>
<kbd>dcpromo /ReplicaOrNewDomain:Replica /ReplicaDomainDNSName:jambajuice.com /Username:Administrator /password:Chiapet1 /SafeModeAdminPassword:Chiapet1</kbd>
<li>Set a static IP Address:</li>
<kbd>netsh interface ip set address "Ethernet" static 10.0.0.10 255.255.0.0 10.0.0.1 1</kbd>
<li>Allow the DC to be pinged:</li>
<kbd>netsh advfirewall firewall add rule name="ICMP Allow for IPV4" protocol=icmpv4:8,any dir=in action=allow</kbd>
</ol>
<h3>Setting up the Workstation</h3>
<ol>
<li>Launch and Administrator <code>cmd.exe</code></li>
<li>Ensure the workstation can communicate with the DC by running <kbd>ping 10.0.0.10</kbd></li>
<li>Join the Domain. Note you will need to use the Domain Administrator password you configured above</li>
<kbd>netdom join %COMPUTERNAME% /domain:jambajuice.com /userd:DA /passwordd:Password<kbd>
</ol>
<h3>Manage Active Directory</h3>
<ol>
<li>On the DC, experiment with the below commands to manage the Active Directory users</li>
<ul>
<li>List Domain Users:</li>
<kbd>dsquery group -name "Domain Admins" | dsget group -members</kbd>
<li>Add a new Domain Admin:</li>
<pre><kbd>dsadd user cn=Bob,ou=Cake,ou=Finance,dc=jambajuice,dc=com -disabled no -pwd Chiapet1
dsquery user -name "Bob" | dsmod group cn="Domain Admins",cn=Users,dc=jambajuice,dc=com -addmbr</kbd></pre>
<li>Rename User Account:</li>
<kbd>dsquery user -name "Bob" | dsmove -newname "Joe"</kbd>
</ul>
</ol>
</div>
</div>
</div>
<div class="tab-pane fade" id="lesson2" role="tabpanel">
<div class="jumbotron">
<div class="container">
<h1 class="display-4">Lesson 2: Lesson Title</h1>
<p class="lead">text</p>
</div>
</div>
</div>
<div class="tab-pane fade" id="lesson3" role="tabpanel">
<div class="jumbotron">
<div class="container">
<h1 class="display-4">Lesson 3: Lesson Title</h1>
<p class="lead">text</p>
</div>
</div>
</div>
<div class="tab-pane fade" id="lesson4" role="tabpanel">
<div class="jumbotron">
<div class="container">
<h1 class="display-4">Lesson 4: Lesson Title</h1>
<p class="lead">text</p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Bootstrap centers text by default: override -->
<style>
ol {
text-align: left!important;
}
</style>