> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://help.elitehost.co.za/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# Getting started with your Unmanaged Linux VPS

After completing your purchase and setup, you’ll receive a welcome email with essential information for accessing your VPS. SSH access will be your initial point of entry to the server. This guide provides foundational steps to access, secure, and install software on your VPS.

### Essential Steps

1. Connect to your server via SSH.
2. Update your VPS.
3. Secure your VPS.
4. Install the required software.

# 1. Connect to your VPS via SSH

**Connecting to SSH on macOS or Linux:**

macOS and Linux come with SSH pre-installed, making it easy to connect through the Terminal.

1. **Open the Terminal** on your computer.
* For MacOS: You can find Terminal in Applications > Utilities or by searching Terminal in Spotlight.
2. Enter the following command, replacing your_vps_ip with the VPS IP address:
`ssh root@your_vps_ip`

**Connecting to SSH on Windows:**

Windows 10 and newer versions come with Windows Terminal, which includes SSH. Alternatively, you may choose to use PuTTY, a widely used SSH client for Windows.

1. Open **Command Prompt** by pressing **Windows + R** , typing **cmd** , and clicking **OK** .
2. In the Command Prompt, enter the following SSH command, replacing your_vps_ip with your VPS IP address:

`ssh root@your_vps_ip`

# 2. Update your VPS

Regularly updating your VPS is critical to maintaining security and performance. Use the package management system appropriate for your Linux distribution to update system packages and repositories:

* **Using apt (Debian/Ubuntu):**
```
apt upgradeapt upgrade
```

* **Using dnf (AlmaLinux, Rocky Linux, CentOS):**
```
dnf update
```

These commands update the package list and install the latest updates, keeping your VPS current and secure.

# 3. Securing Your Linux VPS

Securing your VPS from unauthorised access is essential. Following these best practices will help protect your server:

### 3.1 Change SSH port:

Changing the SSH port from the default port (22) adds an additional layer of security by making your VPS less vulnerable to automated attacks on common ports.

1. **Open the SSH configuration file** :
```
nano /etc/ssh/sshd _config
```

2. **Locate the line #Port 22** , remove the `#` to uncomment it, and change `22` to a new port number (e.g., `7822` ):
```
Port 7822
```

3. **Save the file (ctrl+o then ctrl+x) and restart SSH to apply the changes** :
```bash
systemctl restart sshd
```

4. Connect using the new port number for example: `ssh root@your_vps_ip -p 7822`

### 3.2 Set Up a Firewall:

Use ufw (on Ubuntu) or firewalld (on AlmaLinux, Rocky Linux, CentOS) to allow only necessary traffic, improving your VPS security.

###### Using UFW (Ubuntu/Debian)

1. **Allow the new SSH port** (replace `7822` with your chosen port):
      
```
ufw allow 7822
```

2. **Allow specific services** (e.g., HTTP and HTTPS for web traffic):
      
```
ufw allow http
ufw allow https
```

3. **Enable UFW** :
      
```
ufw enable
```

4. **Verify UFW status** :
      
```
ufw status
```

###### Using firewalld (AlmaLinux, Rocky Linux, CentOS):

1. **Install and start/enable firewalld** (if not already installed):
```
dnf install firewalld
systemctl start firewalld
systemctl enable firewalld
```

4. **Allow the new SSH port** (replace `7822` with your chosen port):
```
firewall-cmd --permanent --add-port=7822/tcp
```

2. **Allow specific services** (e.g., HTTP and HTTPS for web traffic):
```
firewall-cmd --permanent --add-service=http
firewall-cmd --permanent --add-service=https
```

3. **Reload firewalld to apply changes** :
```
firewall-cmd --reload
```

4. **Verify firewalld status** :
```
firewall-cmd --list-all
```

|| Make sure only the necessary ports are open to minimise security risks.

### 3.3 Use SSH keys:

SSH keys offer a more secure, passwordless login method. Generate SSH keys on your local machine, then add the public key to your VPS for enhanced security.

# 4. Install the Necessary Software

Installing software on your VPS depends on the applications you plan to use. Below are the commands for adding software packages based on your Linux distribution:

* **Using apt (Debian/Ubuntu):**
```
apt install package_name
```

* **Using dnf (AlmaLinux, Rocky Linux, CentOS):**
```
dnf install package_name
```

By following these foundational steps, you’ll be well-equipped to get started using your VPS effectively.