Installing OpenSSH SFTP Server on Pop! OS

OpenSSH is a suite of tools that provides secure remote access to a computer system. It comes with a built-in SFTP (Secure File Transfer Protocol) server that allows you to transfer files securely between a client and server. In this tutorial, we will show you how to install OpenSSH SFTP server on Pop! OS.

Prerequisites

Step 1: Installing OpenSSH SFTP Server

  1. Open a terminal window by pressing CTRL+ALT+T on your keyboard.

  2. Type the following command to update your package list:

    sudo apt update
    
  3. Type the following command to install OpenSSH server:

    sudo apt install openssh-server
    
  4. After installation is complete, type the following command to start the OpenSSH service:

    sudo systemctl start ssh
    
  5. Type the following command to enable the OpenSSH service to start at boot:

    sudo systemctl enable ssh
    
  6. Verify OpenSSH is running by typing the following command:

    sudo systemctl status ssh
    

    You should see the status "active (running)".

Step 2: Configuring OpenSSH SFTP Server

By default, OpenSSH SFTP server is already configured to use the default settings. However, you can modify these settings to your preferences.

  1. Type the following command to open the OpenSSH server configuration file:

    sudo nano /etc/ssh/sshd_config
    
  2. Locate the following lines and modify them to uncomment them (remove the #):

    #Subsystem sftp /usr/lib/openssh/sftp-server
    Subsystem sftp internal-sftp
    
  3. To limit the access of the OpenSSH SFTP server to certain accounts or groups, add the following lines to the end of the file:

    # Example to restrict sftp to only one group
    Match group sftp
    ChrootDirectory /home/%u
    X11Forwarding no
    AllowTcpForwarding no
    ForceCommand internal-sftp
    
  4. Save and close the file by pressing CTRL + X, then Y, and ENTER.

  5. Type the following command to restart the OpenSSH service for the changes to take effect:

    sudo systemctl restart ssh
    

Step 3: Using OpenSSH SFTP Server

  1. Open your favorite SFTP client and connect to your Pop! OS instance using your username and password.

  2. You will be able to browse and transfer files securely between your client and server.

Congratulations! You have now successfully installed and configured OpenSSH SFTP server on Pop! OS.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!