Instalasi dan Konfigurasi Remote Server (SSH) Pada Debian 10 Buster

3 min read 2 hours ago
Published on Sep 25, 2024 This response is partially generated with the help of AI. It may contain inaccuracies.

Table of Contents

Introduction

This tutorial provides a comprehensive guide on installing and configuring a remote server using SSH on Debian 10 Buster. SSH (Secure Shell) allows secure remote access to your server, making it essential for managing servers remotely. Following this guide will help you set up your server effectively.

Step 1: Assign an IP Address

To begin, you need to ensure that your server has a static IP address. This will help in consistently accessing your server.

  1. Open the terminal on your Debian server.

  2. Edit the network interfaces configuration file:

    sudo nano /etc/network/interfaces
    
  3. Configure your network settings by entering:

    auto eth0
    iface eth0 inet static
    address [YOUR_STATIC_IP]
    netmask [YOUR_NETMASK]
    gateway [YOUR_GATEWAY_IP]
    
    • Replace [YOUR_STATIC_IP], [YOUR_NETMASK], and [YOUR_GATEWAY_IP] with your actual network information.
  4. Save the file and exit the editor (Ctrl + X, then Y, then Enter).

  5. Restart the networking service to apply changes:

    sudo systemctl restart networking
    

Step 2: Install SSH

Now, you will install the OpenSSH server, which allows you to connect to your server remotely.

  1. Update your package index:

    sudo apt update
    
  2. Install OpenSSH server:

    sudo apt install openssh-server
    
  3. Verify the SSH service is running:

    sudo systemctl status ssh
    
    • If the service is not active, start it using:
    sudo systemctl start ssh
    

Step 3: Configure SSH

You may want to configure the SSH server settings for better security and functionality.

  1. Open the SSH configuration file:

    sudo nano /etc/ssh/sshd_config
    
  2. Consider the following configurations:

    • Change the default port (22) to increase security:
      Port [NEW_PORT]
      
      • Replace [NEW_PORT] with your desired port number.
    • Disable root login for added security:
      PermitRootLogin no
      
    • Allow only specific users:
      AllowUsers [YOUR_USERNAME]
      
  3. Save the changes and exit the editor.

  4. Restart the SSH service to apply the new configurations:

    sudo systemctl restart ssh
    

Step 4: Test Remote Access

To ensure everything is set up correctly, test the SSH connection from a different machine.

  1. Open a terminal on your local machine.

  2. Use the ssh command to connect:

    ssh [YOUR_USERNAME]@[YOUR_STATIC_IP] -p [NEW_PORT]
    
    • Replace [YOUR_USERNAME], [YOUR_STATIC_IP], and [NEW_PORT] with your specific details.
  3. If prompted, enter your password and verify that you can access the server.

Conclusion

You have successfully installed and configured SSH on Debian 10 Buster. Key steps included assigning a static IP, installing the OpenSSH server, configuring SSH settings, and testing remote access. For enhanced security, consider setting up SSH keys for authentication in place of passwords. This process will help you manage your server more efficiently and securely.