How to Set Up Password‑Free SSH Between Linux Machines

Learn step‑by‑step how to install and enable OpenSSH on Linux hosts, generate and copy SSH keys, configure password‑less authentication, and verify connections, with commands and screenshots for both command‑line and GUI methods, ensuring secure remote access without passwords.

Liangxu Linux
Liangxu Linux
Liangxu Linux
How to Set Up Password‑Free SSH Between Linux Machines

Introduction

Linux users can control computers remotely using the Secure Shell (SSH) protocol. This guide explains how to configure SSH on two machines and achieve password‑less login.

Related Terms

Service : background software such as a web server.

Host : any computer that can run services for other machines.

Local : the computer you are currently using (e.g., localhost).

Remote : a computer you access over the network.

Activate SSH on Each Host

Both the client and server parts of SSH must be installed. Verify installation by checking configuration files:

$ file /etc/ssh/ssh_config
/etc/ssh/ssh_config: ASCII text

If the command returns “No such file or directory”, the client is missing. Check the server side similarly:

$ file /etc/ssh/sshd_config
/etc/ssh/sshd_config: ASCII text

Install missing components (example for Fedora/RHEL):

$ sudo dnf install openssh-clients openssh-server

Enable the SSH service on the remote machine: $ sudo systemctl enable --now sshd On GNOME, enable SSH via Settings → Sharing (see screenshot).

Activate SSH in GNOME System Settings
Activate SSH in GNOME System Settings

Test Password Login

After enabling SSH, test a password login using a known user account. Remote users can differ from local users; you only need the correct username and password.

Find the remote machine’s IP address (example shows 10.1.1.5): $ ip addr show | grep "inet " If ip is unavailable, try ifconfig (or ipconfig on Windows).

Ping the remote host to confirm reachability: $ ping -c1 10.1.1.5 Then log in: $ ssh [email protected] Successful login confirms the basic SSH setup.

Create SSH Keys

To log in without a password, generate an SSH key pair. The private key stays on the local machine; the public key is copied to the remote host. $ ssh-keygen -t ed25519 -f ~/.ssh/lan This creates lan (private) and lan.pub (public) files.

Copy the public key to the remote host (you must have password access first):

$ ssh-copy-id -i ~/.ssh/lan.pub [email protected]

After copying, use the private key for future logins: $ ssh -i ~/.ssh/lan [email protected] Repeat the key‑copy process for every machine in the LAN to achieve password‑less access across the network.

Disable Password Authentication (Optional)

To enforce key‑only authentication, edit /etc/ssh/sshd_config on each host and set: PasswordAuthentication no Restart the SSH service to apply the change:

$ sudo systemctl restart sshd && echo "OK"

Everyday Use of SSH

OpenSSH lets you work on any computer from anywhere, breaking the need to sit in front of the machine. Use SSH to manage servers, develop on remote systems, or access IoT devices securely.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

LinuxSSHOpenSSHPasswordlessRemote accesskey authentication
Liangxu Linux
Written by

Liangxu Linux

Liangxu, a self‑taught IT professional now working as a Linux development engineer at a Fortune 500 multinational, shares extensive Linux knowledge—fundamentals, applications, tools, plus Git, databases, Raspberry Pi, etc. (Reply “Linux” to receive essential resources.)

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.