Convert SSH2 Public Key to OpenSSH format · SFTP Gateway Support (2024)

Discover the simple, secure, and affordable way to give SFTP users access to cloud storage locations. Get a 30-day free trial of SFTP Gateway. No credit card or commitment is required.

Overview

An SFTP user provides you with a public key, but they are not able to log in.

There can be a number of reasons for this. But one possibility is that the public key providedis in the wrong format (i.e. SSH2 format).

This article shows you how to convert the SSH2 formatted public key to the OpenSSH format thatSFTP Gateway expects.

Inspect the existing public key

To view the public key of an existing SFTP user, do the following:

  1. SSH into the server.

  2. Run the commands:

sudo susshldap robtest

(Replace robtest with the actual username.)

You should something like this:

ssh-rsa AAAAB3NzaC1yc2...PJtaZWNuT5BJa8GhnzX09g6nhbk= robtest.key

The above example is a public key in the OpenSSH format, which is what SFTP Gateway expects.

If you see the words BEGIN SSH2 PUBLIC KEY, this is an SSH2 formatted public key, andthis needs to be corrected.

An SSH2 formatted public key looks something like this:

---- BEGIN SSH2 PUBLIC KEY ----Comment: "rsa-key-20200402"AAAAB3NzaC1yc2EAAAABJQAAAgEAiL0jjDdFqK/kYThqKt7THrjABTPWvXmB3URI...AEQwc1bG+Z/Gc1Fd8DncgxyhKSQzLsfWroTnIn8wsnmhPJtaZWNuT5BJa8GhnzX09g6nhbk=---- END SSH2 PUBLIC KEY ----

The sshldap command will remove the line-breaks and show all the text on a singe line.

Convert the public key format from SSH2 to OpenSSH

Try to find the original SSH2 public key that was provided from the user.

Otherwise, use the sshldap command to output the SSH2 public key. You may need to manuallyinsert line-breaks at the appropriate places.

Save the SSH2 public key to a file (e.g. ssh2.pub).

Then, run the following command:

ssh-keygen -i -f ssh2.pub 

This takes the SSH2 formatted public key, and outputs an OpenSSH public key.For more information, see https://tutorialinux.com/convert-ssh2-openssh/

At this point, you can set the public key on the SFTP user:

sftpgw.sh update-user --username robtest --pub-ssh "ssh-rsa AAAAB3NzaC1yc2...PJtaZWNuT5BJa8GhnzX09g6nhbk= robtest.key"

Video Reference


Check out our YouTube channel for how-to videos and additional assistance. For even more cloud computing news and tips, connect with us on LinkedIn and Twitter. Don't forget to sign up for your 30-day free trial of SFTP Gateway.

Convert SSH2 Public Key to OpenSSH format · SFTP Gateway Support (2024)
Top Articles
How To Get Out Of A Reverse Mortgage
Xiao Pai
Top 11 Best Bloxburg House Ideas in Roblox - NeuralGamer
Elleypoint
Myexperience Login Northwell
DEA closing 2 offices in China even as the agency struggles to stem flow of fentanyl chemicals
Es.cvs.com/Otchs/Devoted
Fototour verlassener Fliegerhorst Schönwald [Lost Place Brandenburg]
10000 Divided By 5
Brutál jó vegán torta! – Kókusz-málna-csoki trió
Identogo Brunswick Ga
“In my day, you were butch or you were femme”
Hartland Liquidation Oconomowoc
Best Suv In 2010
Bx11
Daily Voice Tarrytown
Check From Po Box 1111 Charlotte Nc 28201
Allentown Craigslist Heavy Equipment
Tyrone Unblocked Games Bitlife
Amortization Calculator
Tips and Walkthrough: Candy Crush Level 9795
Directions To Cvs Pharmacy
Low Tide In Twilight Ch 52
Nesb Routing Number
Koninklijk Theater Tuschinski
Used Patio Furniture - Craigslist
Weathervane Broken Monorail
Culver's.comsummerofsmiles
Poe T4 Aisling
What Happened To Father Anthony Mary Ewtn
Upstate Ny Craigslist Pets
Selfservice Bright Lending
Rise Meadville Reviews
KITCHENAID Tilt-Head Stand Mixer Set 4.8L (Blue) + Balmuda The Pot (White) 5KSM175PSEIC | 31.33% Off | Central Online
Jail View Sumter
Improving curriculum alignment and achieving learning goals by making the curriculum visible | Semantic Scholar
Frigidaire Fdsh450Laf Installation Manual
2024-09-13 | Iveda Solutions, Inc. Announces Reverse Stock Split to be Effective September 17, 2024; Publicly Traded Warrant Adjustment | NDAQ:IVDA | Press Release
Brauche Hilfe bei AzBilliards - Billard-Aktuell.de
Avance Primary Care Morrisville
Haunted Mansion (2023) | Rotten Tomatoes
Cult Collectibles - True Crime, Cults, and Murderabilia
Keci News
Wisconsin Volleyball titt*es
Benjamin Franklin - Printer, Junto, Experiments on Electricity
Dlnet Deltanet
Stoughton Commuter Rail Schedule
10 Best Tips To Implement Successful App Store Optimization in 2024
What Does the Death Card Mean in Tarot?
Runelite Ground Markers
Otter Bustr
How Did Natalie Earnheart Lose Weight
Latest Posts
Article information

Author: Jamar Nader

Last Updated:

Views: 6306

Rating: 4.4 / 5 (55 voted)

Reviews: 86% of readers found this page helpful

Author information

Name: Jamar Nader

Birthday: 1995-02-28

Address: Apt. 536 6162 Reichel Greens, Port Zackaryside, CT 22682-9804

Phone: +9958384818317

Job: IT Representative

Hobby: Scrapbooking, Hiking, Hunting, Kite flying, Blacksmithing, Video gaming, Foraging

Introduction: My name is Jamar Nader, I am a fine, shiny, colorful, bright, nice, perfect, curious person who loves writing and wants to share my knowledge and understanding with you.