How to install public key in host windows server 2012 The 2019 Stack Overflow Developer Survey Results Are InFreeSSHd + 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

How to type a long/em dash `—`

Is it ok to offer lower paid work as a trial period before negotiating for a full-time job?

What information about me do stores get via my credit card?

Straighten subgroup lattice

What to do when moving next to a bird sanctuary with a loosely-domesticated cat?

Likelihood that a superbug or lethal virus could come from a landfill

What do hard-Brexiteers want with respect to the Irish border?

Why doesn't shell automatically fix "useless use of cat"?

Why can't devices on different VLANs, but on the same subnet, communicate?

What is the most efficient way to store a numeric range?

Can an undergraduate be advised by a professor who is very far away?

I am an eight letter word. What am I?

Is it possible for absolutely everyone to attain enlightenment?

Is it okay to consider publishing in my first year of PhD?

What is this sharp, curved notch on my knife for?

Does adding complexity mean a more secure cipher?

How much of the clove should I use when using big garlic heads?

If my opponent casts Ultimate Price on my Phantasmal Bear, can I save it by casting Snap or Curfew?

Kerning for subscripts of sigma?

How to translate "being like"?

Deal with toxic manager when you can't quit

Can you cast a spell on someone in the Ethereal Plane, if you are on the Material Plane and have the True Seeing spell active?

Why don't hard Brexiteers insist on a hard border to prevent illegal immigration after Brexit?

Can I have a signal generator on while it's not connected?



How to install public key in host windows server 2012



The 2019 Stack Overflow Developer Survey Results Are InFreeSSHd + 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









New contributor




xChaax is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.















  • 4





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

    – Martin Prikryl
    yesterday











  • What OS are you using?

    – Dave X
    yesterday











  • ... can do this on their own ... using ssh-copy-id for instance.

    – Bernhard Döbler
    yesterday











  • I’m using windows server 2012 @Dave X

    – xChaax
    yesterday











  • As a client or as a server?

    – Martin Prikryl
    19 hours ago

















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









New contributor




xChaax is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.















  • 4





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

    – Martin Prikryl
    yesterday











  • What OS are you using?

    – Dave X
    yesterday











  • ... can do this on their own ... using ssh-copy-id for instance.

    – Bernhard Döbler
    yesterday











  • I’m using windows server 2012 @Dave X

    – xChaax
    yesterday











  • As a client or as a server?

    – Martin Prikryl
    19 hours ago













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









New contributor




xChaax is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












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









New contributor




xChaax is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




xChaax is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited 13 hours ago







xChaax













New contributor




xChaax is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked yesterday









xChaaxxChaax

163




163




New contributor




xChaax is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





xChaax is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






xChaax is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.







  • 4





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

    – Martin Prikryl
    yesterday











  • What OS are you using?

    – Dave X
    yesterday











  • ... can do this on their own ... using ssh-copy-id for instance.

    – Bernhard Döbler
    yesterday











  • I’m using windows server 2012 @Dave X

    – xChaax
    yesterday











  • As a client or as a server?

    – Martin Prikryl
    19 hours ago












  • 4





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

    – Martin Prikryl
    yesterday











  • What OS are you using?

    – Dave X
    yesterday











  • ... can do this on their own ... using ssh-copy-id for instance.

    – Bernhard Döbler
    yesterday











  • I’m using windows server 2012 @Dave X

    – xChaax
    yesterday











  • As a client or as a server?

    – Martin Prikryl
    19 hours ago







4




4





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

– Martin Prikryl
yesterday





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

– Martin Prikryl
yesterday













What OS are you using?

– Dave X
yesterday





What OS are you using?

– Dave X
yesterday













... can do this on their own ... using ssh-copy-id for instance.

– Bernhard Döbler
yesterday





... can do this on their own ... using ssh-copy-id for instance.

– Bernhard Döbler
yesterday













I’m using windows server 2012 @Dave X

– xChaax
yesterday





I’m using windows server 2012 @Dave X

– xChaax
yesterday













As a client or as a server?

– Martin Prikryl
19 hours ago





As a client or as a server?

– Martin Prikryl
19 hours ago










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
    yesterday











  • See my updated answer.

    – Martin Prikryl
    yesterday






  • 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
    yesterday











  • 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
    22 hours ago











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
);



);






xChaax is a new contributor. Be nice, and check out our Code of Conduct.









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
    yesterday











  • See my updated answer.

    – Martin Prikryl
    yesterday






  • 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
    yesterday











  • 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
    22 hours ago















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
    yesterday











  • See my updated answer.

    – Martin Prikryl
    yesterday






  • 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
    yesterday











  • 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
    22 hours ago













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 yesterday

























answered yesterday









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
    yesterday











  • See my updated answer.

    – Martin Prikryl
    yesterday






  • 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
    yesterday











  • 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
    22 hours ago

















  • 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
    yesterday











  • See my updated answer.

    – Martin Prikryl
    yesterday






  • 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
    yesterday











  • 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
    22 hours ago
















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
yesterday





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
yesterday













See my updated answer.

– Martin Prikryl
yesterday





See my updated answer.

– Martin Prikryl
yesterday




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
yesterday





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
yesterday













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
22 hours ago





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
22 hours ago










xChaax is a new contributor. Be nice, and check out our Code of Conduct.









draft saved

draft discarded


















xChaax is a new contributor. Be nice, and check out our Code of Conduct.












xChaax is a new contributor. Be nice, and check out our Code of Conduct.











xChaax is a new contributor. Be nice, and check out our Code of Conduct.














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

Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

Circuit construction for execution of conditional statements using least significant bitHow are two different registers being used as “control”?How exactly is the stated composite state of the two registers being produced using the $R_zz$ controlled rotations?Efficiently performing controlled rotations in HHLWould this quantum algorithm implementation work?How to prepare a superposed states of odd integers from $1$ to $sqrtN$?Why is this implementation of the order finding algorithm not working?Circuit construction for Hamiltonian simulationHow can I invert the least significant bit of a certain term of a superposed state?Implementing an oracleImplementing a controlled sum operation

Magento 2 “No Payment Methods” in Admin New OrderHow to integrate Paypal Express Checkout with the Magento APIMagento 1.5 - Sales > Order > edit order and shipping methods disappearAuto Invoice Check/Money Order Payment methodAdd more simple payment methods?Shipping methods not showingWhat should I do to change payment methods if changing the configuration has no effects?1.9 - No Payment Methods showing upMy Payment Methods not Showing for downloadable/virtual product when checkout?Magento2 API to access internal payment methodHow to call an existing payment methods in the registration form?