Connecting Your PC to JumpServer and TargetServer: First Steps with SSH Key and Password Authentication Skipped

Abstract: Resolve access denied errors by configuring SSH key authentication for passwordless connections to JumpServer and TargetServer.

Created: 2026-10-08 by

To connect your PC to JumpServer and TargetServer securely, you must generate an SSH key pair on your local machine and add the public key to both servers. This process disables password authentication by default in many configurations, requiring you to use the private key for all subsequent login attempts. Follow these steps to establish a secure, passwordless connection.

Understanding the Authentication Shift

The primary goal of this configuration is to enhance security by eliminating password-based logins, which are vulnerable to brute-force attacks. When you configure SSH keys, the server verifies your identity using cryptographic proof rather than a shared secret string. JumpServer acts as the bastion host or jump box, meaning your traffic from your PC routes through it before reaching the TargetServer. This adds a layer of network isolation but also means you need valid credentials (the private key) for both endpoints. If you previously relied on passwords, skipping this step will result in immediate access denied errors. It is crucial to understand that the private key never leaves your PC, while the public key resides on the servers.

Generating the SSH Key Pair

Before attempting any connections, you need a unique key pair on your local machine. Open your terminal or command prompt and run the following command:
ssh-keygen -t ed25519 -C "[email protected]"
Using ed25519 is recommended over RSA because it is faster and more secure for modern systems. The tool will ask for a file location; pressing Enter accepts the default path (~/.ssh/id_ed25519). You will then be prompted for a passphrase. While optional, adding a strong passphrase encrypts the private key on disk, providing defense-in-depth if the file is stolen. After generation, verify that two files exist in your .ssh directory: id_ed25519 (private) and id_ed25519.pub (public). Never share the private key with anyone or upload it to untrusted repositories. For reference on handling key permissions and troubleshooting related issues, see our guide on Troubleshooting SSH with Private Key.

Adding the Public Key to JumpServer

JumpServer requires the public key to authenticate your user account. Log into the JumpServer web interface and navigate to your user profile settings. Look for the section labeled "SSH Keys" or "Public Keys." Copy the entire content of your id_ed25519.pub file, which starts with ssh-ed25519, and paste it into the input field. Save the changes. Alternatively, if you have command-line access to JumpServer via another method, you can append the public key to the ~/.ssh/authorized_keys file of your specific user account on the JumpServer host. Ensure the permissions on the .ssh directory are set to 700 and the authorized_keys file is 600.

Configuring TargetServer Access

Once JumpServer trusts your key, you must do the same for the TargetServer. Since you cannot log in directly with a password anymore, you might need to use a temporary password if one is still enabled, or use a different out-of-band method provided by your system administrator. Add the same public key to the ~/.ssh/authorized_keys file on the TargetServer. If you are managing multiple servers, consider using an SSH config file to streamline connections. Create or edit ~/.ssh/config on your PC:
Host jumpserver
    HostName 
    User 
    IdentityFile ~/.ssh/id_ed25519

Host targetserver
    HostName 
    User 
    ProxyJump jumpserver
    IdentityFile ~/.ssh/id_ed25519
The ProxyJump directive tells SSH to automatically route the connection to targetserver through jumpserver. This simplifies the workflow, allowing you to type ssh targetserver instead of manually chaining sessions. If you encounter resolution issues during this setup, check our article on SSH: Temporary Name Resolution Failure for 'desktop11900' for common DNS pitfalls.

Testing the Connection

Verify the setup by initiating a connection from your PC to JumpServer first. Run:
ssh jumpserver
If configured correctly, you should be logged in without a password prompt. Next, test the proxy connection to the TargetServer:
ssh targetserver
You should now be inside the TargetServer environment. If you receive a permission denied error, check that the private key file has correct read-only permissions for the owner (chmod 400). Also, ensure that password authentication is disabled on the servers only after you have confirmed key-based access works reliably. Disabling it prematurely can lock you out. For further details on connecting to cloud instances with similar constraints, refer to Connecting to an EC2 instance using SSH with password authentication - Ubuntu 22.04.

Troubleshooting Common Issues

If the connection fails, enable verbose mode to see detailed logs:
ssh -v targetserver
Look for lines indicating "Offering public key" and whether the server accepts it. A common mistake is having incorrect ownership of the .ssh directory, which causes SSH to ignore the key for security reasons. Another issue is the server rejecting the key due to strict host key checking if the server was reinstalled. In such cases, remove the old entry from ~/.ssh/known_hosts. Always back up your private key securely, as losing it may require administrative intervention to reset access.

Frequently Asked Questions

Can I keep password authentication enabled alongside SSH keys?

Yes, you can leave password authentication enabled as a fallback, but it is strongly discouraged for security reasons. Most organizations enforce policies that disable password logins once keys are established to prevent brute-force attacks. If you must keep it, ensure you use strong, unique passwords until you switch entirely to keys.

What happens if I lose my private key?

If you lose your private key, you will be locked out of the servers unless you have another authentication method or physical console access. You must regenerate a new key pair and update the public keys on JumpServer and TargetServer. Always store backups of your private key in a secure, encrypted location.

Why does SSH still ask for a passphrase even though I set up a key?

This occurs if you added a passphrase when generating the key. The private key is encrypted on your disk, so you must enter the passphrase to decrypt it before SSH can use it. If you did not want a passphrase, you would need to regenerate the key without one, though this reduces security slightly.

How do I fix "Permission Denied (publickey)" errors?

This error usually means the server does not recognize your public key or the client is not offering it. Verify that the public key is correctly appended to ~/.ssh/authorized_keys on the server side. On the client side, ensure the private key file permissions are set to 600 and that the key matches the one on the server.

Is ProxyJump supported on older versions of SSH?

No, the ProxyJump directive was introduced in OpenSSH 7.3. If you are using an older version, you must manually chain connections by logging into the jump server first and then executing SSH from there. Consider upgrading your local SSH client to take advantage of simplified multi-hop configurations.

Latest News

How to Display Output of xterm Command in Terminal Screen using Cron

Resolve the inability to display xterm output in a terminal screen from cron by redirecting logs or using wall instead of insecure X11 workarounds.

Read More
Expose Local Server on VPS Preserving Real Client IPs (OS Level)

Resolve VPS logging showing only gateway IPs by configuring reverse proxies to forward real client addresses via X-Forwarded-For headers.

Read More
How to Clear Recent Files History in Linux without Deleting Actual Files?

Clear recent files history in Linux by deleting ~/.local/share/recently-used.xbel without removing the actual files.

Read More
Best HDD Copy Strategy: Manually Syncing and Rewriting Scratch

Resolve data drift between two 4TB hard drives by using rsync with the --delete flag to manually sync and rewrite scratch data for an exact mirror.

Read More
Understanding Bash Prompt Abbreviations: An Overview

Resolve repetitive typing errors by creating and persisting Bash aliases in the .bashrc file for improved command-line efficiency.

Read More
Free Tools and Methods to Log Real-Time Performance Details in Task Manager

Log real-time CPU and memory metrics to CSV files using Windows Performance Monitor Data Collector Sets to troubleshoot system slowness.

Read More
Contact Qatar Airways Customer Service: Phone Number, Help Center, and More

Resolve urgent Qatar Airways reservation issues like flight changes and baggage claims using the US phone number +1801-855-5905 or online self-service tools.

Read More
Windows 11: Alt Codes Displaying Wrong Characters - Solutions

Resolve Windows 11 Alt codes showing wrong characters by verifying the US keyboard layout and enabling Num Lock.

Read More
Run Programs with Elevated Privileges: A Comprehensive Guide

Eliminates the need to type sudo for frequent administrative tasks by configuring .bashrc aliases or functions.

Read More
Dynamically Changing Dates in Excel Formulas Using Cells

Eliminate manual date updates in Excel by using cell references to create dynamic formulas that automatically adjust calculations when input dates change.

Read More
Granting Edit Access to a Specific Excel Sheet in an Office 365 User Email ID-Based Login

Excel Online lacks native sheet-level permissions, so users must split workbooks or use worksheet protection to isolate edit access for specific tabs.

Read More
Creating Network Load on Local Wi-Fi from One PC

Generate sustained Wi-Fi bandwidth load from a single PC using a VM SFTP server to test router stability and throughput.

Read More
Changing the Default Editor for Batch Files in Windows 11's File Explorer

Resolve the issue of batch files opening in Notepad by changing the default editor to a preferred application like VS Code.

Read More
Gain WiFi Connection Minutes Before Losing it by Changing MAC Address

Bypass MAC address filtering to restore WiFi connectivity temporarily when a device is blocked by network administrators.

Read More
Photos Folders Turned Black: Troubleshooting Picture Applications on Windows

Resolve black screens in Windows Photos by resetting the app, updating graphics drivers, and repairing system files.

Read More
Troubleshooting High CPU Temperature Values: A Step-by-Step Guide

Resolve high CPU temperatures and thermal throttling by monitoring with Speedfan, cleaning dust from cooling components, and replacing degraded thermal paste.

Read More
Make cURL establish TLS connection with CA unknown

Resolve cURL TLS connection failures with unknown or self-signed certificates by using the --insecure flag to bypass CA validation.

Read More
Troubleshooting Incorrect Network Metrics Values in Grafana, Prometheus, InfluxDB, and Telegraf

Fix incorrect network metrics in Grafana, Prometheus, InfluxDB, and Telegraf by verifying interface selection, resolving unit mismatches, and handling counter resets.

Read More
Start Another Terminal Window (cmd.exe) Windows Repair/Troubleshoot

Provides step-by-step instructions to access the Windows Command Prompt via bootable media for advanced system repair and troubleshooting.

Read More
Thinkpad P1 Gen 6: Sudden Thunderbolt 3 Dock USB-C Charging Stopped Working

Resolve sudden Thunderbolt 3 dock USB-C charging and internet failure on ThinkPad P1 Gen 6 by updating firmware, resetting the dock, and adjusting power settings.

Read More
ASUS Windows 11 Laptop: Internet Connection Issue with Hotspot

Resolve ASUS Windows 11 laptop spinning wheel issue when connecting to mobile hotspot by resetting network stack, disabling IPv6, and adjusting power settings.

Read More
Developing iOS Project with Firebase: Logging in and Sending Push Notifications

Integrates Firebase to enable secure user authentication and push notifications in iOS applications.

Read More
Troubleshooting Bash Script with Suspected Issues of Spaces, Dashes, Filenames and Quoting

Resolve Bash script failures caused by word splitting, globbing, and special characters in filenames by applying proper quoting techniques.

Read More
Populating OneDrive Folder for Local Backup without Affecting Remote Files

Prevent OneDrive from deleting remote files during Windows reinstallation by unlinking the account or using symbolic links to isolate local data.

Read More
Force First Frame as Keyframe Without Re-encoding: A Quick Solution

Resolve inaccurate seeking and playback glitches by re-encoding video to ensure the first frame is a valid keyframe.

Read More
Find Information in Database Using WSL (Ubuntu) on Windows-10

Resolve database connection issues from WSL Ubuntu on Windows 10 by configuring client tools and network access to query remote or local servers.

Read More
Configuring a New Router with Different Networks: One Family, One Guest

Resolve IP conflicts and isolate guest traffic by configuring a second router with a distinct subnet via its WAN port.

Read More
Quickly Open Multiple Stock Websites with a Single Command

Solve the problem of manually opening multiple stock research websites by creating a single command to launch them simultaneously on Windows, macOS, or Linux.

Read More
Improved Adobe Acrobat Search Experience: Access Advanced Search with Ease

Access advanced search filters like case sensitivity and regex in Adobe Acrobat by clicking More Options in the Find bar.

Read More
Port Forwarding VM via OpenVPN: A Comprehensive Guide

Configure OpenVPN server and iptables to forward specific ports from VPN clients to a virtual machine's internal IP address.

Read More
Understanding Partitions in the 1980s: A Look Back at MS-DOS and Master Boot Record

Explains how the Master Boot Record and partition table enabled MS-DOS to manage multiple disk volumes on a single physical drive.

Read More
Windows 10 Enterprise: Keyboard Not Detected in Managed Organization with Admin Privileges

Resolve Windows 10 Enterprise keyboard detection failures caused by Group Policy restrictions, driver corruption, or USB enumeration errors.

Read More
Can't Find x86_64 Versions of Applications on MacOS arm64 (M1)

Resolve missing x86_64 app issues on M1 Macs by installing Rosetta 2 and reinstalling apps as universal binaries.

Read More
How to Hide Installation Source for an Android App

Manage Android app installation source visibility by using USB transfers or file managers to reduce browser traces and isolate data via work profiles.

Read More
Connecting Momentus 4200.2 ST9808210A Hard Drive via USB Cable

Resolve inability to access Seagate Momentus 4200.2 ST9808210A hard drive by connecting it via USB using a compatible SATA-to-USB adapter and configuring the disk in Windows.

Read More