> For the complete documentation index, see [llms.txt](https://securitylab.gitbook.io/assiment1/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://securitylab.gitbook.io/assiment1/master.md).

# #1 Assignment Lab Guide

#### This guide will help you with:

1. Login and change password
2. Import VM from NAS
3. Set up VM
4. Back up VM to NAS
5. Logout

## **Important**

* When copy any code, don't copy the following mentioned symbols at the beginning of each line.
* "$" precedes Linux commands that are typed at a regular user's shell prompt, usually your host machine
* "#" precedes Linux commands that are typed at a root shell prompt, usually in a VM
* Machines in the lab cannot connect to Internet but you are able to do yum install basic software with local yum repositories.
* All assignments should be done in the lab.
* Please back up everything you need for later use to NAS. If you don't, it's possible that your data or VMs get destroyed.

## Login and change password

Start computer and login with username and initial password given at first class. You can login to any machine in the lab.

Once login, please open a terminal and change your password at first

![](https://2041469829-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LKjFAK7Sr5SIEqwe9Q7%2F-LKr_5v6Qnmlvz64EWsy%2F-LKr_Dl6UZxZR5X9jBaN%2FWeChat%20Screenshot_20180826145052.png?alt=media\&token=3a60d31c-b0fc-4c6a-b569-10ef1f11952f)

```
[username@clemson11 ~]$ passwd
Changing password for user username.
Current Password: 
New password: 
Retype new password: 
passwd: all authentication tokens updated successfully.
[username@clemson11 ~]$ 
```

## Import VM from NAS

A network attached storage (NAS) is used to store all iso images, scripts, as well as your backups.

```
[username@clemson11 ~]$ sftp username@192.168.10.5:VMs/Assign1_VM.ova .
username@192.168.10.5's password: 
Connected to 192.168.10.5.
Fetching /VMs/Assign1_VM.ova to ./Assign1_VM.ova
/VMs/Assign1_VM.ova                                                                                               100% 2352MB  72.0MB/s   00:32    
sftp> exit
[username@clemson11 ~]$ vboxmanage import Assign1_VM.ova 
```

For students in Charleston, use "sftp username\@192.168.20.5".

## Set up VM

Open Oracle VM VirtualBox

![Oracle VM VirtuaBox](https://2041469829-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LKjFAK7Sr5SIEqwe9Q7%2F-LKktcu2O87KMlR2M-52%2F-LKl2aVQC0U6NDjJZ5na%2Fvmbox.jpg?alt=media\&token=20c28a05-9dc8-4dde-b606-c59473df2e97)

Click on Settings, make sure it attached to "Bridged Adapter", and click at the exchange button to generates a new random MAC address (next to MAC Address).

![](https://2041469829-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LKjFAK7Sr5SIEqwe9Q7%2F-LKktcu2O87KMlR2M-52%2F-LKlEGpdWqRA5CDFwxEb%2F1.png?alt=media\&token=dd2e9389-f598-4659-9429-f02453bf0f52)

Start VM, login with username: root, password: root. Type "startx" to GUI.&#x20;

![](https://2041469829-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LKjFAK7Sr5SIEqwe9Q7%2F-LKr_5v6Qnmlvz64EWsy%2F-LKr_XpvO0IVQnIkCNH9%2FWeChat%20Screenshot_20180826144745.png?alt=media\&token=5fbf8b99-f394-4484-aef9-420c46459c22)

Then change the password.

```
[root@localhost ~]# passwd
Changing password for user root.
New password: 
BAD PASSWORD: The password is shorter than 8 characters
Retype new password: 
passwd: all authentication tokens updated successfully.
[root@localhost ~]# 
```

Change IP address to the one given on first day of class. This step doesn't finish until you turn off network and then turn on.

![](https://2041469829-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LKjFAK7Sr5SIEqwe9Q7%2F-LKr_5v6Qnmlvz64EWsy%2F-LKrVCJ79Au0lt6TfRvZ%2FScreenshot%20from%202018-08-26%2014-27-54.png?alt=media\&token=f7c75e43-894f-4e20-b19e-4688c3178d70)

![](https://2041469829-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LKjFAK7Sr5SIEqwe9Q7%2F-LKr_5v6Qnmlvz64EWsy%2F-LKrVp9T6NmBFEjH5PHj%2FScreenshot%20from%202018-08-26%2014-31-30.png?alt=media\&token=194a6ff1-aee0-4c8c-9437-13bc91e89157)

![](https://2041469829-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LKjFAK7Sr5SIEqwe9Q7%2F-LKr_5v6Qnmlvz64EWsy%2F-LKrXzHRrEAxtk8gLgux%2FScreenshot%20from%202018-08-26%2014-32-54.png?alt=media\&token=0fa1a8e3-482e-46bc-a640-3e4315744015)

\
For Charleston students, Address: 192.168.20.xxx, Gateway: 192.168.20.1

## Back up VM to NAS

```
[username@clemson10 ~]$ sftp username@192.168.10.5
username@192.168.10.5's password: 
Connected to 192.168.10.5.
sftp> ls
VMs   home  
sftp> cd home/  
sftp> put -r VirtualBox\ VMs/Assign1_VM/
Uploading VirtualBox VMs/Assign1_VM/ to /home/Assign1_VM
Entering VirtualBox VMs/Assign1_VM/
```

For students in Charleston, use "sftp username\@192.168.20.5".

To delete a file:

```
sftp> cd home/
sftp> ls
Assign1_VM   tmp          
sftp> rm tmp 
Removing /home/tmp
```

To delete all files in a folder:

```
sftp> rm Assign1_VM/*
Removing /home/Assign1_VM/Assign1_VM-disk001.vmdk
```

To delete a folder:

```
sftp> rmdir Assign1_VM/
```

To make a folder:

```
sftp> mkdir foldername
```

Get your back up folder:

```
sftp> get -r foldername/
```

or file:

```
sftp> get filename
```

You can download your back up from NAS on any machines in the lab.

## Logout

Please logout of your account before leave the lab, which will protect your account. Do not power off the machine.

![](https://2041469829-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LKjFAK7Sr5SIEqwe9Q7%2F-LL18vPkNOdtmtbbVngS%2F-LL198oCxghxU7sMcRPY%2FWeChat%20Image_20180828160850.jpg?alt=media\&token=ccafdc4d-671b-4c96-9bd3-cbaf4ea869a8)

![](https://2041469829-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LKjFAK7Sr5SIEqwe9Q7%2F-LL18vPkNOdtmtbbVngS%2F-LL19Cw17BQ-umVImKHy%2FWeChat%20Image_20180828160910.jpg?alt=media\&token=6e35e600-d313-4e2f-adb1-17913b2b72d1)
