Install OpenSSH on your Desktop

To install and configure OpenSSH on a KDE Plasma system, you’ll typically use your distribution’s package manager. Once installed, you can then configure the server and client settings.

Installation:

  1. 1. Using your distribution’s package manager:
    • For Ubuntu and Debian-based systems: sudo apt install openssh-server openssh-client
    • For Fedora and Red Hat-based systems: sudo dnf install openssh openssh-server
    • For Arch Linux and derivatives: sudo pacman -S openssh
  2. 2. Enable and start the SSH service:
    • sudo systemctl enable --now sshd
    • This command ensures the SSH service starts automatically on boot. 

Configuration:

  1. 1. OpenSSH Server Configuration:
    • The main configuration file for the OpenSSH server is /etc/ssh/sshd_config
    • You can edit this file using a text editor with root privileges.
    • Important: Before making changes, it’s a good idea to back up the original configuration: sudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak 
    • Common configuration options include:
      • Port: The port SSH listens on (default is 22).
      • PermitRootLogin: Controls whether root users can log in via SSH (generally recommended to disable).
      • PasswordAuthentication: Controls whether password-based authentication is allowed (using SSH keys is more secure).
      • PubkeyAuthentication: Controls whether public key authentication is enabled.
      • StrictModes: Controls how file permissions are enforced (recommended to be enabled).
    • After making changes, restart the SSH service: sudo systemctl restart sshd 
  2. 2. OpenSSH Client Configuration:
    • If you’re using Konsole, you can configure it to use the SSH Manager plugin for managing connections. 
    • You can also configure SSH settings within Konsole’s preferences.
    • For general SSH client configuration, you can use the ssh_config file located in your home directory (~/.ssh/config). 

Key Management:

  1. 1. Generating SSH keys:
    • ssh-keygen -t rsa
    • This command generates a public and private key pair.
    • You can optionally add a passphrase to your private key for added security.
  2. 2. Distributing public keys:
    • ssh-copy-id user@hostname
    • This command copies your public key to the ~/.ssh/authorized_keys file on the remote server. 

Additional Tips:

  • Consider using a firewall (like ufw on Ubuntu) to restrict SSH access to only necessary IP addresses. 
  • If you’re using KWallet to store your SSH passphrase, you can configure it to automatically unlock on login. 
  • For connecting to an SSH proxy, you can use the sshuttle command-line utility or configure a proxy in your browser. 
  • KDE Plasma offers various tools for managing network connections, including SSH connections, through the Network Manager. 

You May Have Missed