Where do I get SSH host key fingerprint to authorize the server? :: WinSCP (2024)

Documentation » Support » FAQ (Frequently Asked Questions) » Connecting to the Server »

  • Host key fingerprint is an integral part of session information
  • Safely obtaining host key
  • Obtaining host key from PuTTY
  • Host key of your virtual server
  • Automatic host key verification

Advertisem*nt

Host key fingerprint is an integral part of session information

You should get an SSH host key fingerprint along with your credentials from a server administrator. Knowing the host key fingerprint and thus being able to verify it is an integral part of securing an SSH connection. It prevents man-in-the-middle attacks.

Safely obtaining host key

In the real world, most administrators do not provide the host key fingerprint.

Instead you can ask anyone else who has a physical access to the server or who already knows the host key. The host key is only one and hence the same for all users. Also note that the host key fingerprint is generated from a public key part of the host key only. So it is not secret and can be safely sent over unencrypted (yet trusted) communication channels.

If you do not have anyone else to obtain the fingerprint from, you may need to connect to the server without knowing the fingerprint. Before connecting for the first time, ensure a security of your local machine and a line to the server. For example if you plan to connect to the server from an external site (e.g. from home or a client), but you have a physical access to the server site, connect from the server site the first time (e.g. your workplace).

Once you connect, WinSCP caches the fingerprint and will ensure, that the key is unchanged every time you connect later on.

If you need to know the fingerprint later on for other purposes, like to verify the host key on another machine, or for automation, go to a Server and Protocol Information Dialog. See a Server Host key Fingerprint box.

Obtaining host key from PuTTY

If you already have the host key cached in the PuTTY SSH client, you can import a PuTTY stored session to WinSCP, including the cached host keys. Make sure the Import cached host keys for checked sites option is checked when importing the sessions.

Advertisem*nt

You can also have the fingerprint displayed in an SSH terminal using ssh-keygen command (on *nix servers that use OpenSSH server). For example:

ssh-keygen -l -f /etc/ssh/ssh_host_rsa_key

To display all available host keys, you can use:

for f in /etc/ssh/ssh_host_*_key; do ssh-keygen -l -f "$f"; done

OpenSSH 6.8 and newer shows SHA-256 fingerprint by default. Older versions use MD5 fingerprint.

Host key of your virtual server

A special case is getting host key of a server, that you are an administrator of yourself, yet you do not have a direct secure line to connect through. This is common for virtual servers or servers in a cloud. In such case a server provider should have a specific solution. For example a specialized server in the same private network as your server, with publicly known host keys. You can connect to this specialized server and from it, securely connect to your server (e.g. using SSH terminal). As you are connecting within private network, you can safely trust any host key. Once connected to your server, acquire its host key. With that you can finally connect directly yet securely over a public network. Alternatively, the server provider can provide the host key via some administrative interface. For example see a solution for Amazon EC2, Google Compute Engine or Microsoft Azure.

Automatic host key verification

When writing a WinSCP script or code using WinSCP .NET assembly, use the same methods as described previously to obtain the host key.

In scripting specify the expected fingerprint using -hostkey switch of an open command. With .NET assembly, use SessionOptions.SshHostKeyFingerprint property. Use SHA-256 fingerprint of the host key.

If you already have verified the host key for your GUI session, go to a Server and Protocol Information Dialog and see a Server Host key Fingerprint box. You can have WinSCP generate the script or code for you, including the -hostkey switch or SessionOptions.SshHostKeyFingerprint property.

In exceptional situations, when security is not required, such as when connecting within a trusted private network, you can use -hostkey=* or SessionOptions.GiveUpSecurityAndAcceptAnySshHostKey to blindly accept any host key.

If you want to allow a user to manually verify the host key, use the Session.ScanFingerprint method to retrieve the key fingerprint. Then let the user to verify it and assign the verified value to the SessionOptions.SshHostKeyFingerprint property. For an example of an implementation see Implementing SSH host key cache (known hosts).

Where do I get SSH host key fingerprint to authorize the server? :: WinSCP (2024)
Top Articles
Eagle Scout Palms 101: Everything You Need To Know | ScoutSmarts
6 Things to Know About Giardia in Dogs in Crown Point, IN - Coyne Veterinary Center
Joe Taylor, K1JT – “WSJT-X FT8 and Beyond”
Where are the Best Boxing Gyms in the UK? - JD Sports
Cooking Chutney | Ask Nigella.com
Workday Latech Edu
Guardians Of The Galaxy Showtimes Near Athol Cinemas 8
Wannaseemypixels
Shorthand: The Write Way to Speed Up Communication
Activities and Experiments to Explore Photosynthesis in the Classroom - Project Learning Tree
Nestle Paystub
Jet Ski Rental Conneaut Lake Pa
My.doculivery.com/Crowncork
Echo & the Bunnymen - Lips Like Sugar Lyrics
Dallas’ 10 Best Dressed Women Turn Out for Crystal Charity Ball Event at Neiman Marcus
Craigslist Malone New York
272482061
Love In The Air Ep 9 Eng Sub Dailymotion
Scenes from Paradise: Where to Visit Filming Locations Around the World - Paradise
Ou Class Nav
Band Of Loyalty 5E
Effingham Bookings Florence Sc
TBM 910 | Turboprop Aircraft - DAHER TBM 960, TBM 910
Costco Great Oaks Gas Price
Aldi Bruce B Downs
Troy Gamefarm Prices
CVS Health’s MinuteClinic Introduces New Virtual Care Offering
O'reilly's In Monroe Georgia
Kleinerer: in Sinntal | markt.de
Elanco Rebates.com 2022
Ourhotwifes
Haley Gifts :: Stardew Valley
Audi Q3 | 2023 - 2024 | De Waal Autogroep
Jennifer Reimold Ex Husband Scott Porter
Obsidian Guard's Skullsplitter
Scanning the Airwaves
Woodman's Carpentersville Gas Price
Has any non-Muslim here who read the Quran and unironically ENJOYED it?
Entry of the Globbots - 20th Century Electro​-​Synthesis, Avant Garde & Experimental Music 02;31,​07 - Volume II, by Various
1Exquisitetaste
Sand Castle Parents Guide
Satucket Lectionary
Guided Practice Activities 5B-1 Answers
Arcanis Secret Santa
Scythe Banned Combos
9294027542
Mejores páginas para ver deportes gratis y online - VidaBytes
Shannon Sharpe Pointing Gif
Mikayla Campinos Alive Or Dead
Sleep Outfitters Springhurst
2121 Gateway Point
Latest Posts
Article information

Author: Gregorio Kreiger

Last Updated:

Views: 6506

Rating: 4.7 / 5 (57 voted)

Reviews: 80% of readers found this page helpful

Author information

Name: Gregorio Kreiger

Birthday: 1994-12-18

Address: 89212 Tracey Ramp, Sunside, MT 08453-0951

Phone: +9014805370218

Job: Customer Designer

Hobby: Mountain biking, Orienteering, Hiking, Sewing, Backpacking, Mushroom hunting, Backpacking

Introduction: My name is Gregorio Kreiger, I am a tender, brainy, enthusiastic, combative, agreeable, gentle, gentle person who loves writing and wants to share my knowledge and understanding with you.