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 Read and Understand a Profit and Loss Statement
How To Find Undervalued Stocks in India Online? | 5paisa
Use Copilot in Microsoft Teams meetings
Dte Outage Map Woodhaven
4-Hour Private ATV Riding Experience in Adirondacks 2024 on Cool Destinations
Nfr Daysheet
7543460065
Unraveling The Mystery: Does Breckie Hill Have A Boyfriend?
Back to basics: Understanding the carburetor and fixing it yourself - Hagerty Media
Jscc Jweb
Indiana Immediate Care.webpay.md
10 Free Employee Handbook Templates in Word & ClickUp
سریال رویای شیرین جوانی قسمت 338
Dirt Removal in Burnet, TX ~ Instant Upfront Pricing
Jayah And Kimora Phone Number
Craigslist Mt Pleasant Sc
Golden Abyss - Chapter 5 - Lunar_Angel
Labby Memorial Funeral Homes Leesville Obituaries
Zoe Mintz Adam Duritz
Google Doodle Baseball 76
CVS Near Me | Columbus, NE
Sea To Dallas Google Flights
Parc Soleil Drowning
Gotcha Rva 2022
Craigslist Roseburg Oregon Free Stuff
Dark Entreaty Ffxiv
Weldmotor Vehicle.com
Copper Pint Chaska
Afni Collections
Horses For Sale In Tn Craigslist
Infinite Campus Asd20
Dailymotion
Craigslistodessa
Kamzz Llc
Mercedes W204 Belt Diagram
Account Now Login In
The Rise of "t33n leaks": Understanding the Impact and Implications - The Digital Weekly
Petsmart Distribution Center Jobs
404-459-1280
The 50 Best Albums of 2023
The Transformation Of Vanessa Ray From Childhood To Blue Bloods - Looper
Infinite Campus Farmingdale
2132815089
Coroner Photos Timothy Treadwell
Dickdrainersx Jessica Marie
Embry Riddle Prescott Academic Calendar
Headlining Hip Hopper Crossword Clue
Dlnet Deltanet
18 Seriously Good Camping Meals (healthy, easy, minimal prep! )
The Plug Las Vegas Dispensary
Edict Of Force Poe
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.