How to install public key in host server The 2019 Stack Overflow Developer Survey Results Are InHow to retrieve a public key from remote host?FreeSSHd + 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 usersSSH Public Key AuthenticationWhere do i need to put my public rsa key on the server to allow passwordless ssh authentication?Cannot ssh into server: Permission Denied (Public Key)SSH Server refused public-key signature despite accepting keyLogging Into Windows 10 OpenSSH Server With Public Key

Where to refill my bottle in India?

Are USB sockets on wall outlets live all the time, even when the switch is off?

Is it true that “A.D.” is traditionally placed before the year number?

How to manage monthly salary

Why don't Unix/Linux systems traverse through directories until they find the required version of a linked library?

Is this food a bread or a loaf?

Why do some words that are not inflected have an umlaut?

How long do I have to send my income tax payment to the IRS?

Recording with midi/synth vs actual instrument?

How to deal with fear of taking dependencies

I see my dog run

Extreme, unacceptable situation and I can't attend work tomorrow morning

Flying Bloodthirsty Lampshades

I am seven letter word. Find me Who Am I?

Geography at the pixel level

I looked up a future colleague on LinkedIn before I started a job. I told my colleague about it and he seemed surprised. Should I apologize?

Deadlock Graph and Interpretation, solution to avoid

Are there any other methods to apply to solving simultaneous equations?

Inflated grade on resume at previous job, might former employer tell new employer?

What are the motivations for publishing new editions of an existing textbook, beyond new discoveries in a field?

Where does the "burst of radiance" from Holy Weapon originate?

Why do UK politicians seemingly ignore opinion polls on Brexit?

Dual Citizen. Exited the US on Italian passport recently

What is the use of option -o in the useradd command?



How to install public key in host server



The 2019 Stack Overflow Developer Survey Results Are InHow to retrieve a public key from remote host?FreeSSHd + 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 usersSSH Public Key AuthenticationWhere do i need to put my public rsa key on the server to allow passwordless ssh authentication?Cannot 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;








2















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?










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.




















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

















2















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?










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.




















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













2












2








2


1






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?










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?







ssh 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 2 hours ago









Martin Prikryl

11.3k43379




11.3k43379






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









xChaaxxChaax

112




112




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.












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

















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
















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





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










1 Answer
1






active

oldest

votes


















4














  • 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 converts 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.




  • 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
    1 hour ago











  • See my updated answer.

    – Martin Prikryl
    1 hour 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-server%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









4














  • 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 converts 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.




  • 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
    1 hour ago











  • See my updated answer.

    – Martin Prikryl
    1 hour ago















4














  • 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 converts 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.




  • 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
    1 hour ago











  • See my updated answer.

    – Martin Prikryl
    1 hour ago













4












4








4







  • 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 converts 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.




  • 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 converts 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.




  • 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 1 min ago

























answered 2 hours ago









Martin PrikrylMartin Prikryl

11.3k43379




11.3k43379












  • 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
    1 hour ago











  • See my updated answer.

    – Martin Prikryl
    1 hour 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
    1 hour ago











  • See my updated answer.

    – Martin Prikryl
    1 hour 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
1 hour 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
1 hour ago













See my updated answer.

– Martin Prikryl
1 hour ago





See my updated answer.

– Martin Prikryl
1 hour 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-server%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

名間水力發電廠 目录 沿革 設施 鄰近設施 註釋 外部連結 导航菜单23°50′10″N 120°42′41″E / 23.83611°N 120.71139°E / 23.83611; 120.7113923°50′10″N 120°42′41″E / 23.83611°N 120.71139°E / 23.83611; 120.71139計畫概要原始内容臺灣第一座BOT 模式開發的水力發電廠-名間水力電廠名間水力發電廠 水利署首件BOT案原始内容《小檔案》名間電廠 首座BOT水力發電廠原始内容名間電廠BOT - 經濟部水利署中區水資源局

Prove that NP is closed under karp reduction?Space(n) not closed under Karp reductions - what about NTime(n)?Class P is closed under rotation?Prove or disprove that $NL$ is closed under polynomial many-one reductions$mathbfNC_2$ is closed under log-space reductionOn Karp reductionwhen can I know if a class (complexity) is closed under reduction (cook/karp)Check if class $PSPACE$ is closed under polyonomially space reductionIs NPSPACE also closed under polynomial-time reduction and under log-space reduction?Prove PSPACE is closed under complement?Prove PSPACE is closed under union?

Is my guitar’s action too high? Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern)Strings too stiff on a recently purchased acoustic guitar | Cort AD880CEIs the action of my guitar really high?Μy little finger is too weak to play guitarWith guitar, how long should I give my fingers to strengthen / callous?When playing a fret the guitar sounds mutedPlaying (Barre) chords up the guitar neckI think my guitar strings are wound too tight and I can't play barre chordsF barre chord on an SG guitarHow to find to the right strings of a barre chord by feel?High action on higher fret on my steel acoustic guitar