Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

Here's a breakdown of the tasks and steps required as per the exam instructions:

1. **Creating a New User Account:**


- Command to create a new user account named "john":
```bash
sudo adduser john
```

2. **Renaming the Username:**


- John has been promoted and needs his username changed to "jdoe":
```bash
sudo usermod -l jdoe john
sudo groupmod -n jdoe john
sudo mv /home/john /home/jdoe
sudo usermod -d /home/jdoe -m jdoe
```

3. **Managing Directories and Permissions:**


- Create a directory named "project_docs" within the user's home directory:
```bash
mkdir /home/jdoe/project_docs
```
- Configure the permissions for "project_docs":
```bash
sudo chown jdoe:jdoe /home/jdoe/project_docs
sudo chmod 700 /home/jdoe/project_docs
sudo setfacl -m g:projectgroup:r-x /home/jdoe/project_docs
```

4. **Samba Configuration:**
- Define the role of a Samba server:
Samba facilitates file sharing between Windows and Linux systems.
- Configure a directory named "shared_docs" for Samba:
- Create the directory:
```bash
mkdir /srv/samba/shared_docs
```
- Edit the Samba configuration file (`/etc/samba/smb.conf`) and add:
```bash
[shared_docs]
path = /srv/samba/shared_docs
browsable = yes
writable = yes
guest ok = yes
```
- Restart Samba services:
```bash
sudo systemctl restart smbd
sudo systemctl restart nmbd
```

5. **Apache Web Server Setup:**


- Explain the purpose:
Apache is used for hosting websites and managing user authentication.
- Installation process:
```bash
sudo apt update
sudo apt install apache2
sudo systemctl start apache2
sudo systemctl enable apache2
```

6. **User Authentication and Directory Protection:**


- Role of `/etc/shadow` file:
It stores hashed passwords for user accounts.
- Protecting a directory named "secure_area" using Basic Authentication:
- Install necessary tools:
```bash
sudo apt-get install apache2-utils
```
- Create a password file:
```bash
sudo htpasswd -c /etc/apache2/.htpasswd user1
```
- Configure Apache to use this authentication:
Edit the Apache configuration file or the relevant virtual host file:
```apache
<Directory /var/www/html/secure_area>
AuthType Basic
AuthName "Restricted Content"
AuthUserFile /etc/apache2/.htpasswd
Require valid-user
</Directory>
```
- Restart Apache:
```bash
sudo systemctl restart apache2
```

7. **System Logs Maintenance:**


- Display the last 50 lines of the system log file:
```bash
tail -n 50 /var/log/syslog
```

8. **Firewall Configuration for SSH:**


- Allow incoming traffic on port 22 (SSH):
```bash
sudo ufw allow 22
sudo ufw enable
```

9. **Setting Up a Secure Remote Connection:**


- Step-by-step outline for setting up a secure connection between two remote offices:
- Install OpenVPN:
```bash
sudo apt-get install openvpn
```
- Configure the server and client configurations:
Create server configuration file (`/etc/openvpn/server.conf`) and client configuration file accordingly.
- Start the OpenVPN service:
```bash
sudo systemctl start openvpn@server
```
- Ensure that the necessary firewall rules are in place to allow VPN traffic.

This summary should help address each of the tasks outlined in the exam paper.

You might also like