---
title: How to Access  A Server via SSH/Terminal
description: "SSH (Secure Shell) is a secure way to access a server remotely. Here's a quick guide on how to do that, using the IP `178.32.214.84` as an example. ### **Prerequisites for SSH Access** To access a server via SSH, you…"
url: "https://truehost.com/support/knowledge-base/how-to-access-a-server-via-ssh-terminal/"
updated: "2024-10-07"
category: Cloud servers in Kenya
---

# How to Access  A Server via SSH/Terminal

SSH (Secure Shell) is a secure way to access a server remotely. Here's a quick guide on how to do that, using the IP `178.32.214.84` as an example.

### **Prerequisites for SSH Access**

To access a server via SSH, you must ensure the following:

1. **SSH Service is Enabled on the Server**: SSH must be running on the server. Most Linux servers come with SSH enabled by default.
2. **Correct IP Address**: You need the correct server IP address. In this guide, we are using `178.32.214.84` as an example.
3. **Username**: You must have the username for the account you wish to access on the server.
4. **Authentication Method**: You must have either:
   - A **password** for the username (password authentication), or
   - An **SSH key pair** (private and public keys) if using key-based authentication (preferred for security).
5. **Port**: By default, SSH uses port 22. If the server is configured to use a different port, you’ll need that information.

### **Method 1: Access Using Password Authentication**

1. **Open Terminal**:
   - On **Linux** and **macOS**, open the terminal directly.
   - On **Windows**, you can use **Windows Powershell** or an SSH client like **[PuTTY](https://www.putty.org/)** or [Termius](https://termius.com/download/windows).
2. **Run SSH Command**: In the terminal, use the following command:
   **ssh`username@178.32.214.84`**``

   Replace `username` with your actual server username and the IP with the actual server IP or hostname.
   For example, if your username is `root`, the command would be: `ssh root@178.32.214.84`
3. **Enter Password**: When prompted, type the password for the user and press Enter. After successfully entering the password, you will have access to the server.

![](https://truehost.com/support/wp-content/uploads/2024/09/ssh.png)

### **Method 2: Access Using SSH Key Pair**

SSH key authentication is more secure than using passwords. You need to have the private key file on your local machine.

1. **Generate or Obtain SSH Keys**: If you don't already have an SSH key pair, you can generate one using: `ssh-keygen -t rsa -b 4096`
   This will create a private key (`id_rsa`) and a public key (`id_rsa.pub`). You will need to place the public key on the server under the user's `.ssh/authorized_keys` file.
2. **Use SSH with Key**: Run the following command to connect using your private key:
   `ssh -i /path/to/private-key username@178.32.214.84`

   For example: `ssh -i ~/.ssh/id_rsa root@178.32.214.84`
3. **Enter Passphrase (if applicable)**: If your private key is protected with a passphrase, you will be prompted to enter it. Once authenticated, you will be logged into the server.

### Additional Options

- **Specifying a Different Port**: If SSH is running on a non-default port (other than 22), you can specify it with the `-p` flag:
  `ssh -p 2222 username@178.32.214.84`
- **Logging Out**: To end your session and log out of the server, simply type: `exit`

### Example Commands

1. **SSH with password:** `ssh root@178.32.214.84`
2. **SSH with key-based authentication:** `ssh -i ~/.ssh/id_rsa root@178.32.214.84`
3. **SSH with a custom port:** `ssh -p 2222 root@178.32.214.84`
