How to install public key in host windows server 2012 Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)winscp displays “server refused our key” when try to connect to windows server 2012 from windows 10FreeSSHd + WinSCP: “Server refused public-key signature despite accepting key!”How to Use SSH With a Given Public KeyCan I change the filename of my ssh public/private key pair?Install public key via ssh-copy-id for other usersWhat is the public key file that is generated by PuTTY?Where do i need to put my public rsa key on the server to allow passwordless ssh authentication?WinSCP and PuTTY SSH (SFTP) authentication to Windows OpenSSH server won't work using public keysCannot ssh into server: Permission Denied (Public Key)SSH Server refused public-key signature despite accepting keyLogging Into Windows 10 OpenSSH Server With Public Key

Can you shove before Attacking with Shield Master using a Readied action?

Why wasn't DOSKEY integrated with command.com?

8 Prisoners wearing hats

How can I make names more distinctive without making them longer?

How to down pick a chord with skipped strings?

Is it ethical to give a final exam after the professor has quit before teaching the remaining chapters of the course?

Why didn't Eitri join the fight?

Do square wave exist?

An adverb for when you're not exaggerating

How come Sam didn't become Lord of Horn Hill?

Is there a holomorphic function on open unit disc with this property?

Can an alien society believe that their star system is the universe?

If my PI received research grants from a company to be able to pay my postdoc salary, did I have a potential conflict interest too?

Can a party unilaterally change incumbent candidates in preparation for a General election?

Withdrew £2800, but only £2000 shows as withdrawn on online banking; what are my obligations?

Do I really need recursive chmod to restrict access to a folder?

Can anything be seen from the center of the Boötes void? How dark would it be?

If a contract sometimes uses the wrong name, is it still valid?

Significance of Cersei's obsession with elephants?

2001: A Space Odyssey's use of the song "Daisy Bell" (Bicycle Built for Two); life imitates art or vice-versa?

How do I stop a creek from eroding my steep embankment?

How to compare two different files line by line in unix?

What are the out-of-universe reasons for the references to Toby Maguire-era Spider-Man in ITSV

Tht Aain’t Right... #2



How to install public key in host windows server 2012



Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)winscp displays “server refused our key” when try to connect to windows server 2012 from windows 10FreeSSHd + WinSCP: “Server refused public-key signature despite accepting key!”How to Use SSH With a Given Public KeyCan I change the filename of my ssh public/private key pair?Install public key via ssh-copy-id for other usersWhat is the public key file that is generated by PuTTY?Where do i need to put my public rsa key on the server to allow passwordless ssh authentication?WinSCP and PuTTY SSH (SFTP) authentication to Windows OpenSSH server won't work using public keysCannot ssh into server: Permission Denied (Public Key)SSH Server refused public-key signature despite accepting keyLogging Into Windows 10 OpenSSH Server With Public Key



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








3















My user from another server gave his public key to me and asked me to install this public key into my server so he can connect to my server. Did some research and I have to create a directory called .ssh and paste my user public key in a Notepad and save this text file into the .ssh directory. My question is does my research correct if so where and how I create this .ssh directory and the key file, is it in text file format? Do I have to pass any information like my key to the user? I’m using Windows Server 2012.










share|improve this question
























  • Comments are not for extended discussion; this conversation has been moved to chat.

    – DavidPostill
    Apr 12 at 19:40

















3















My user from another server gave his public key to me and asked me to install this public key into my server so he can connect to my server. Did some research and I have to create a directory called .ssh and paste my user public key in a Notepad and save this text file into the .ssh directory. My question is does my research correct if so where and how I create this .ssh directory and the key file, is it in text file format? Do I have to pass any information like my key to the user? I’m using Windows Server 2012.










share|improve this question
























  • Comments are not for extended discussion; this conversation has been moved to chat.

    – DavidPostill
    Apr 12 at 19:40













3












3








3


5






My user from another server gave his public key to me and asked me to install this public key into my server so he can connect to my server. Did some research and I have to create a directory called .ssh and paste my user public key in a Notepad and save this text file into the .ssh directory. My question is does my research correct if so where and how I create this .ssh directory and the key file, is it in text file format? Do I have to pass any information like my key to the user? I’m using Windows Server 2012.










share|improve this question
















My user from another server gave his public key to me and asked me to install this public key into my server so he can connect to my server. Did some research and I have to create a directory called .ssh and paste my user public key in a Notepad and save this text file into the .ssh directory. My question is does my research correct if so where and how I create this .ssh directory and the key file, is it in text file format? Do I have to pass any information like my key to the user? I’m using Windows Server 2012.







ssh windows-server-2012 openssh sftp






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Apr 11 at 13:16







xChaax

















asked Apr 10 at 5:25









xChaaxxChaax

144




144












  • Comments are not for extended discussion; this conversation has been moved to chat.

    – DavidPostill
    Apr 12 at 19:40

















  • Comments are not for extended discussion; this conversation has been moved to chat.

    – DavidPostill
    Apr 12 at 19:40
















Comments are not for extended discussion; this conversation has been moved to chat.

– DavidPostill
Apr 12 at 19:40





Comments are not for extended discussion; this conversation has been moved to chat.

– DavidPostill
Apr 12 at 19:40










1 Answer
1






active

oldest

votes


















12














  • The public key must go into authorized_keys file (not just to some text file) in the .ssh subfolder of user's home directory.


  • The public key entry must have a correct format like:



    ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAir2cIHsAFg8QzLF6Yb... some optional comment


  • The authorized_keys file must use *nix line endings, what Notepad cannot do (so make sure your SFTP/FTP client uses ASCII transfer mode to convert the line endings)


  • The .ssh folder needs to have 700 permissions and the authorized_keys needs to have 600 permissions.

There are zillions of guides on the Internet that cover the above.

For example see my guide to Setting up SSH public key authentication in OpenSSH.




If the user is already a user on your server (has password [or other] authentication working), he/she can setup the public key on his/her own.



  • On *nix machines (or others that have OpenSSH available, what may include Windows), you can use ssh-copy-id script.

  • On Windows machines, you can use (my) WinSCP, with its Install Public Key into Server function.

See also my answer to Setting up public key authentication to Linux server from Windows (ppk private key).




You should provide your user a copy of the server's public host key, so that the user can verify it, when connecting for the first time (it's a separate from the authentication, what the rest of the question is about). Though many users just blindly accept the host key.






share|improve this answer

























  • Does it matter what directory for .ssh folder ? If does, what directory is home directory? And what is the format for authorized_keys file ?

    – xChaax
    Apr 10 at 7:15











  • See my updated answer.

    – Martin Prikryl
    Apr 10 at 7:18






  • 5





    More generally, the public key must go in whatever file is specified as AuthorizedKeysFile in sshd_config, which by default is ~/.ssh/authorized_keys

    – user4556274
    Apr 10 at 12:02











  • It's a bit of a sloppy hack, but on new machines I generally run a 'ssh-keygen' to create the ~/.ssh/ directory in the proper place with the proper permissions, and then copy keys into the authorized_keys file.

    – Dave X
    Apr 11 at 3:29











Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "3"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1423613%2fhow-to-install-public-key-in-host-windows-server-2012%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









12














  • The public key must go into authorized_keys file (not just to some text file) in the .ssh subfolder of user's home directory.


  • The public key entry must have a correct format like:



    ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAir2cIHsAFg8QzLF6Yb... some optional comment


  • The authorized_keys file must use *nix line endings, what Notepad cannot do (so make sure your SFTP/FTP client uses ASCII transfer mode to convert the line endings)


  • The .ssh folder needs to have 700 permissions and the authorized_keys needs to have 600 permissions.

There are zillions of guides on the Internet that cover the above.

For example see my guide to Setting up SSH public key authentication in OpenSSH.




If the user is already a user on your server (has password [or other] authentication working), he/she can setup the public key on his/her own.



  • On *nix machines (or others that have OpenSSH available, what may include Windows), you can use ssh-copy-id script.

  • On Windows machines, you can use (my) WinSCP, with its Install Public Key into Server function.

See also my answer to Setting up public key authentication to Linux server from Windows (ppk private key).




You should provide your user a copy of the server's public host key, so that the user can verify it, when connecting for the first time (it's a separate from the authentication, what the rest of the question is about). Though many users just blindly accept the host key.






share|improve this answer

























  • Does it matter what directory for .ssh folder ? If does, what directory is home directory? And what is the format for authorized_keys file ?

    – xChaax
    Apr 10 at 7:15











  • See my updated answer.

    – Martin Prikryl
    Apr 10 at 7:18






  • 5





    More generally, the public key must go in whatever file is specified as AuthorizedKeysFile in sshd_config, which by default is ~/.ssh/authorized_keys

    – user4556274
    Apr 10 at 12:02











  • It's a bit of a sloppy hack, but on new machines I generally run a 'ssh-keygen' to create the ~/.ssh/ directory in the proper place with the proper permissions, and then copy keys into the authorized_keys file.

    – Dave X
    Apr 11 at 3:29















12














  • The public key must go into authorized_keys file (not just to some text file) in the .ssh subfolder of user's home directory.


  • The public key entry must have a correct format like:



    ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAir2cIHsAFg8QzLF6Yb... some optional comment


  • The authorized_keys file must use *nix line endings, what Notepad cannot do (so make sure your SFTP/FTP client uses ASCII transfer mode to convert the line endings)


  • The .ssh folder needs to have 700 permissions and the authorized_keys needs to have 600 permissions.

There are zillions of guides on the Internet that cover the above.

For example see my guide to Setting up SSH public key authentication in OpenSSH.




If the user is already a user on your server (has password [or other] authentication working), he/she can setup the public key on his/her own.



  • On *nix machines (or others that have OpenSSH available, what may include Windows), you can use ssh-copy-id script.

  • On Windows machines, you can use (my) WinSCP, with its Install Public Key into Server function.

See also my answer to Setting up public key authentication to Linux server from Windows (ppk private key).




You should provide your user a copy of the server's public host key, so that the user can verify it, when connecting for the first time (it's a separate from the authentication, what the rest of the question is about). Though many users just blindly accept the host key.






share|improve this answer

























  • Does it matter what directory for .ssh folder ? If does, what directory is home directory? And what is the format for authorized_keys file ?

    – xChaax
    Apr 10 at 7:15











  • See my updated answer.

    – Martin Prikryl
    Apr 10 at 7:18






  • 5





    More generally, the public key must go in whatever file is specified as AuthorizedKeysFile in sshd_config, which by default is ~/.ssh/authorized_keys

    – user4556274
    Apr 10 at 12:02











  • It's a bit of a sloppy hack, but on new machines I generally run a 'ssh-keygen' to create the ~/.ssh/ directory in the proper place with the proper permissions, and then copy keys into the authorized_keys file.

    – Dave X
    Apr 11 at 3:29













12












12








12







  • The public key must go into authorized_keys file (not just to some text file) in the .ssh subfolder of user's home directory.


  • The public key entry must have a correct format like:



    ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAir2cIHsAFg8QzLF6Yb... some optional comment


  • The authorized_keys file must use *nix line endings, what Notepad cannot do (so make sure your SFTP/FTP client uses ASCII transfer mode to convert the line endings)


  • The .ssh folder needs to have 700 permissions and the authorized_keys needs to have 600 permissions.

There are zillions of guides on the Internet that cover the above.

For example see my guide to Setting up SSH public key authentication in OpenSSH.




If the user is already a user on your server (has password [or other] authentication working), he/she can setup the public key on his/her own.



  • On *nix machines (or others that have OpenSSH available, what may include Windows), you can use ssh-copy-id script.

  • On Windows machines, you can use (my) WinSCP, with its Install Public Key into Server function.

See also my answer to Setting up public key authentication to Linux server from Windows (ppk private key).




You should provide your user a copy of the server's public host key, so that the user can verify it, when connecting for the first time (it's a separate from the authentication, what the rest of the question is about). Though many users just blindly accept the host key.






share|improve this answer















  • The public key must go into authorized_keys file (not just to some text file) in the .ssh subfolder of user's home directory.


  • The public key entry must have a correct format like:



    ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAir2cIHsAFg8QzLF6Yb... some optional comment


  • The authorized_keys file must use *nix line endings, what Notepad cannot do (so make sure your SFTP/FTP client uses ASCII transfer mode to convert the line endings)


  • The .ssh folder needs to have 700 permissions and the authorized_keys needs to have 600 permissions.

There are zillions of guides on the Internet that cover the above.

For example see my guide to Setting up SSH public key authentication in OpenSSH.




If the user is already a user on your server (has password [or other] authentication working), he/she can setup the public key on his/her own.



  • On *nix machines (or others that have OpenSSH available, what may include Windows), you can use ssh-copy-id script.

  • On Windows machines, you can use (my) WinSCP, with its Install Public Key into Server function.

See also my answer to Setting up public key authentication to Linux server from Windows (ppk private key).




You should provide your user a copy of the server's public host key, so that the user can verify it, when connecting for the first time (it's a separate from the authentication, what the rest of the question is about). Though many users just blindly accept the host key.







share|improve this answer














share|improve this answer



share|improve this answer








edited Apr 10 at 16:43

























answered Apr 10 at 6:19









Martin PrikrylMartin Prikryl

11.4k43381




11.4k43381












  • Does it matter what directory for .ssh folder ? If does, what directory is home directory? And what is the format for authorized_keys file ?

    – xChaax
    Apr 10 at 7:15











  • See my updated answer.

    – Martin Prikryl
    Apr 10 at 7:18






  • 5





    More generally, the public key must go in whatever file is specified as AuthorizedKeysFile in sshd_config, which by default is ~/.ssh/authorized_keys

    – user4556274
    Apr 10 at 12:02











  • It's a bit of a sloppy hack, but on new machines I generally run a 'ssh-keygen' to create the ~/.ssh/ directory in the proper place with the proper permissions, and then copy keys into the authorized_keys file.

    – Dave X
    Apr 11 at 3:29

















  • Does it matter what directory for .ssh folder ? If does, what directory is home directory? And what is the format for authorized_keys file ?

    – xChaax
    Apr 10 at 7:15











  • See my updated answer.

    – Martin Prikryl
    Apr 10 at 7:18






  • 5





    More generally, the public key must go in whatever file is specified as AuthorizedKeysFile in sshd_config, which by default is ~/.ssh/authorized_keys

    – user4556274
    Apr 10 at 12:02











  • It's a bit of a sloppy hack, but on new machines I generally run a 'ssh-keygen' to create the ~/.ssh/ directory in the proper place with the proper permissions, and then copy keys into the authorized_keys file.

    – Dave X
    Apr 11 at 3:29
















Does it matter what directory for .ssh folder ? If does, what directory is home directory? And what is the format for authorized_keys file ?

– xChaax
Apr 10 at 7:15





Does it matter what directory for .ssh folder ? If does, what directory is home directory? And what is the format for authorized_keys file ?

– xChaax
Apr 10 at 7:15













See my updated answer.

– Martin Prikryl
Apr 10 at 7:18





See my updated answer.

– Martin Prikryl
Apr 10 at 7:18




5




5





More generally, the public key must go in whatever file is specified as AuthorizedKeysFile in sshd_config, which by default is ~/.ssh/authorized_keys

– user4556274
Apr 10 at 12:02





More generally, the public key must go in whatever file is specified as AuthorizedKeysFile in sshd_config, which by default is ~/.ssh/authorized_keys

– user4556274
Apr 10 at 12:02













It's a bit of a sloppy hack, but on new machines I generally run a 'ssh-keygen' to create the ~/.ssh/ directory in the proper place with the proper permissions, and then copy keys into the authorized_keys file.

– Dave X
Apr 11 at 3:29





It's a bit of a sloppy hack, but on new machines I generally run a 'ssh-keygen' to create the ~/.ssh/ directory in the proper place with the proper permissions, and then copy keys into the authorized_keys file.

– Dave X
Apr 11 at 3:29

















draft saved

draft discarded
















































Thanks for contributing an answer to Super User!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1423613%2fhow-to-install-public-key-in-host-windows-server-2012%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Romeo and Juliet ContentsCharactersSynopsisSourcesDate and textThemes and motifsCriticism and interpretationLegacyScene by sceneSee alsoNotes and referencesSourcesExternal linksNavigation menu"Consumer Price Index (estimate) 1800–"10.2307/28710160037-3222287101610.1093/res/II.5.31910.2307/45967845967810.2307/2869925286992510.1525/jams.1982.35.3.03a00050"Dada Masilo: South African dancer who breaks the rules"10.1093/res/os-XV.57.1610.2307/28680942868094"Sweet Sorrow: Mann-Korman's Romeo and Juliet Closes Sept. 5 at MN's Ordway"the original10.2307/45957745957710.1017/CCOL0521570476.009"Ram Leela box office collections hit massive Rs 100 crore, pulverises prediction"Archived"Broadway Revival of Romeo and Juliet, Starring Orlando Bloom and Condola Rashad, Will Close Dec. 8"Archived10.1075/jhp.7.1.04hon"Wherefore art thou, Romeo? To make us laugh at Navy Pier"the original10.1093/gmo/9781561592630.article.O006772"Ram-leela Review Roundup: Critics Hail Film as Best Adaptation of Romeo and Juliet"Archived10.2307/31946310047-77293194631"Romeo and Juliet get Twitter treatment""Juliet's Nurse by Lois Leveen""Romeo and Juliet: Orlando Bloom's Broadway Debut Released in Theaters for Valentine's Day"Archived"Romeo and Juliet Has No Balcony"10.1093/gmo/9781561592630.article.O00778110.2307/2867423286742310.1076/enst.82.2.115.959510.1080/00138380601042675"A plague o' both your houses: error in GCSE exam paper forces apology""Juliet of the Five O'Clock Shadow, and Other Wonders"10.2307/33912430027-4321339124310.2307/28487440038-7134284874410.2307/29123140149-661129123144728341M"Weekender Guide: Shakespeare on The Drive""balcony"UK public library membership"romeo"UK public library membership10.1017/CCOL9780521844291"Post-Zionist Critique on Israel and the Palestinians Part III: Popular Culture"10.2307/25379071533-86140377-919X2537907"Capulets and Montagues: UK exam board admit mixing names up in Romeo and Juliet paper"Istoria Novellamente Ritrovata di Due Nobili Amanti2027/mdp.390150822329610820-750X"GCSE exam error: Board accidentally rewrites Shakespeare"10.2307/29176390149-66112917639"Exam board apologises after error in English GCSE paper which confused characters in Shakespeare's Romeo and Juliet""From Mariotto and Ganozza to Romeo and Guilietta: Metamorphoses of a Renaissance Tale"10.2307/37323537323510.2307/2867455286745510.2307/28678912867891"10 Questions for Taylor Swift"10.2307/28680922868092"Haymarket Theatre""The Zeffirelli Way: Revealing Talk by Florentine Director""Michael Smuin: 1938-2007 / Prolific dance director had showy career"The Life and Art of Edwin BoothRomeo and JulietRomeo and JulietRomeo and JulietRomeo and JulietEasy Read Romeo and JulietRomeo and Julieteeecb12003684p(data)4099369-3n8211610759dbe00d-a9e2-41a3-b2c1-977dd692899302814385X313670221313670221

Creating closest line along the point''s azimuth using PostgreSQL Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?Drawing line between points at specific distance in PostGIS?How to efficiently find the closest point over the dateline?How to find the nearest point by using PostGIS function?PostGIS nearest point with LATERAL JOIN in PostgreSQL 9.3+Creating a table and inserting selected streets using plpgsql functionsCreating a table that stores Distances and other columnSaving select query results (year wise) from PostgreSQL/PostGIS to text filesWhat is the information behind this geometry?How to give start and end vertex ids dynamically in pgr_dijkstra?Point to Polygon nearest distance DS_distance is not using geography index & knn <-> or <#> does not give result in orderLine to point conversion with start point and end point detection?

Crop image to path created in TikZ? Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)Crop an inserted image?TikZ pictures does not appear in posterImage behind and beyond crop marks?Tikz picture as large as possible on A4 PageTransparency vs image compression dilemmaHow to crop background from image automatically?Image does not cropTikzexternal capturing crop marks when externalizing pgfplots?How to include image path that contains a dollar signCrop image with left size given