SSH private keys fails when trying to login

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP












0















I have a problem with ssh that keeps asking me for periphrase and password.



I first generated a public/private key-pair using



ssh-keygen -t rsa -C my-login@my-server.com


it ask me for a file to save the keys and a periphrase then generated



ssh-keygen -t rsa -C my-login@my-server.com
Generating public/private rsa key pair.
Enter file in which to save the key (/home/<USERNAME>/.ssh/id_rsa): SSH_priv_key
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in SSH_priv_key.
Your public key has been saved in SSH_priv_key.pub.
The key fingerprint is:
??:??:??:??:??:??:??:??:??:??:??:??:??:??:??:?? my-login@my-server.com

The key's randomart image is:
+---[RSA 2048]----+
.....


I then logged in to another shell and downloaded the private key from the first shell and entered



ssh -i ~/.ssh/private-key.txt my-login@my-server.com


at first it asked for for the periphrase and the password,
I did so (telling myself that this is maybe normal since its the first login from/to those shells)



then I logged out and tried to login again but it keep asking me for periphrase and the password.



So I'v read man ssh-keygen, google'd read docs/tutorials and changed then entered command to



ssh-keygen -trsa -b 2048 -f ~/.ssh/my-server.com


and tried to login again but got the same results.



I don't know what to do now.










share|improve this question
























  • did you use ssh-add to add the new key to your keyring?

    – drewbenn
    Jan 4 at 22:03







  • 1





    "downloaded the private key" ... are you sure you're copying the right thing? Usually you copy your public key around, and keep your private key in the original system.

    – msb
    Jan 4 at 22:13











  • It's hard to tell how much you have obfuscated the ssh-keygen interaction, but if you really entered SSH_priv_key as the file name, then you will need to use ssh -i SSH_priv_key my-login@my-server.com

    – steeldriver
    Jan 4 at 22:20






  • 1





    Be careful when manually coping ssh keys, sshd does only allow ~/.ssh/authorized_keys with file permissions of user as owner and 0600. Typically umask is not setup this way.

    – hargut
    Jan 4 at 23:23











  • Please clarify (in your question) on which of each of the two machines you're running each step. You shouldn't be generating a private key on a server that's then used from a client, for example.

    – roaima
    Jan 4 at 23:23















0















I have a problem with ssh that keeps asking me for periphrase and password.



I first generated a public/private key-pair using



ssh-keygen -t rsa -C my-login@my-server.com


it ask me for a file to save the keys and a periphrase then generated



ssh-keygen -t rsa -C my-login@my-server.com
Generating public/private rsa key pair.
Enter file in which to save the key (/home/<USERNAME>/.ssh/id_rsa): SSH_priv_key
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in SSH_priv_key.
Your public key has been saved in SSH_priv_key.pub.
The key fingerprint is:
??:??:??:??:??:??:??:??:??:??:??:??:??:??:??:?? my-login@my-server.com

The key's randomart image is:
+---[RSA 2048]----+
.....


I then logged in to another shell and downloaded the private key from the first shell and entered



ssh -i ~/.ssh/private-key.txt my-login@my-server.com


at first it asked for for the periphrase and the password,
I did so (telling myself that this is maybe normal since its the first login from/to those shells)



then I logged out and tried to login again but it keep asking me for periphrase and the password.



So I'v read man ssh-keygen, google'd read docs/tutorials and changed then entered command to



ssh-keygen -trsa -b 2048 -f ~/.ssh/my-server.com


and tried to login again but got the same results.



I don't know what to do now.










share|improve this question
























  • did you use ssh-add to add the new key to your keyring?

    – drewbenn
    Jan 4 at 22:03







  • 1





    "downloaded the private key" ... are you sure you're copying the right thing? Usually you copy your public key around, and keep your private key in the original system.

    – msb
    Jan 4 at 22:13











  • It's hard to tell how much you have obfuscated the ssh-keygen interaction, but if you really entered SSH_priv_key as the file name, then you will need to use ssh -i SSH_priv_key my-login@my-server.com

    – steeldriver
    Jan 4 at 22:20






  • 1





    Be careful when manually coping ssh keys, sshd does only allow ~/.ssh/authorized_keys with file permissions of user as owner and 0600. Typically umask is not setup this way.

    – hargut
    Jan 4 at 23:23











  • Please clarify (in your question) on which of each of the two machines you're running each step. You shouldn't be generating a private key on a server that's then used from a client, for example.

    – roaima
    Jan 4 at 23:23













0












0








0








I have a problem with ssh that keeps asking me for periphrase and password.



I first generated a public/private key-pair using



ssh-keygen -t rsa -C my-login@my-server.com


it ask me for a file to save the keys and a periphrase then generated



ssh-keygen -t rsa -C my-login@my-server.com
Generating public/private rsa key pair.
Enter file in which to save the key (/home/<USERNAME>/.ssh/id_rsa): SSH_priv_key
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in SSH_priv_key.
Your public key has been saved in SSH_priv_key.pub.
The key fingerprint is:
??:??:??:??:??:??:??:??:??:??:??:??:??:??:??:?? my-login@my-server.com

The key's randomart image is:
+---[RSA 2048]----+
.....


I then logged in to another shell and downloaded the private key from the first shell and entered



ssh -i ~/.ssh/private-key.txt my-login@my-server.com


at first it asked for for the periphrase and the password,
I did so (telling myself that this is maybe normal since its the first login from/to those shells)



then I logged out and tried to login again but it keep asking me for periphrase and the password.



So I'v read man ssh-keygen, google'd read docs/tutorials and changed then entered command to



ssh-keygen -trsa -b 2048 -f ~/.ssh/my-server.com


and tried to login again but got the same results.



I don't know what to do now.










share|improve this question
















I have a problem with ssh that keeps asking me for periphrase and password.



I first generated a public/private key-pair using



ssh-keygen -t rsa -C my-login@my-server.com


it ask me for a file to save the keys and a periphrase then generated



ssh-keygen -t rsa -C my-login@my-server.com
Generating public/private rsa key pair.
Enter file in which to save the key (/home/<USERNAME>/.ssh/id_rsa): SSH_priv_key
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in SSH_priv_key.
Your public key has been saved in SSH_priv_key.pub.
The key fingerprint is:
??:??:??:??:??:??:??:??:??:??:??:??:??:??:??:?? my-login@my-server.com

The key's randomart image is:
+---[RSA 2048]----+
.....


I then logged in to another shell and downloaded the private key from the first shell and entered



ssh -i ~/.ssh/private-key.txt my-login@my-server.com


at first it asked for for the periphrase and the password,
I did so (telling myself that this is maybe normal since its the first login from/to those shells)



then I logged out and tried to login again but it keep asking me for periphrase and the password.



So I'v read man ssh-keygen, google'd read docs/tutorials and changed then entered command to



ssh-keygen -trsa -b 2048 -f ~/.ssh/my-server.com


and tried to login again but got the same results.



I don't know what to do now.







ssh






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 4 at 21:57









Rui F Ribeiro

39.5k1479133




39.5k1479133










asked Jan 4 at 21:06









user2901196user2901196

61




61












  • did you use ssh-add to add the new key to your keyring?

    – drewbenn
    Jan 4 at 22:03







  • 1





    "downloaded the private key" ... are you sure you're copying the right thing? Usually you copy your public key around, and keep your private key in the original system.

    – msb
    Jan 4 at 22:13











  • It's hard to tell how much you have obfuscated the ssh-keygen interaction, but if you really entered SSH_priv_key as the file name, then you will need to use ssh -i SSH_priv_key my-login@my-server.com

    – steeldriver
    Jan 4 at 22:20






  • 1





    Be careful when manually coping ssh keys, sshd does only allow ~/.ssh/authorized_keys with file permissions of user as owner and 0600. Typically umask is not setup this way.

    – hargut
    Jan 4 at 23:23











  • Please clarify (in your question) on which of each of the two machines you're running each step. You shouldn't be generating a private key on a server that's then used from a client, for example.

    – roaima
    Jan 4 at 23:23

















  • did you use ssh-add to add the new key to your keyring?

    – drewbenn
    Jan 4 at 22:03







  • 1





    "downloaded the private key" ... are you sure you're copying the right thing? Usually you copy your public key around, and keep your private key in the original system.

    – msb
    Jan 4 at 22:13











  • It's hard to tell how much you have obfuscated the ssh-keygen interaction, but if you really entered SSH_priv_key as the file name, then you will need to use ssh -i SSH_priv_key my-login@my-server.com

    – steeldriver
    Jan 4 at 22:20






  • 1





    Be careful when manually coping ssh keys, sshd does only allow ~/.ssh/authorized_keys with file permissions of user as owner and 0600. Typically umask is not setup this way.

    – hargut
    Jan 4 at 23:23











  • Please clarify (in your question) on which of each of the two machines you're running each step. You shouldn't be generating a private key on a server that's then used from a client, for example.

    – roaima
    Jan 4 at 23:23
















did you use ssh-add to add the new key to your keyring?

– drewbenn
Jan 4 at 22:03






did you use ssh-add to add the new key to your keyring?

– drewbenn
Jan 4 at 22:03





1




1





"downloaded the private key" ... are you sure you're copying the right thing? Usually you copy your public key around, and keep your private key in the original system.

– msb
Jan 4 at 22:13





"downloaded the private key" ... are you sure you're copying the right thing? Usually you copy your public key around, and keep your private key in the original system.

– msb
Jan 4 at 22:13













It's hard to tell how much you have obfuscated the ssh-keygen interaction, but if you really entered SSH_priv_key as the file name, then you will need to use ssh -i SSH_priv_key my-login@my-server.com

– steeldriver
Jan 4 at 22:20





It's hard to tell how much you have obfuscated the ssh-keygen interaction, but if you really entered SSH_priv_key as the file name, then you will need to use ssh -i SSH_priv_key my-login@my-server.com

– steeldriver
Jan 4 at 22:20




1




1





Be careful when manually coping ssh keys, sshd does only allow ~/.ssh/authorized_keys with file permissions of user as owner and 0600. Typically umask is not setup this way.

– hargut
Jan 4 at 23:23





Be careful when manually coping ssh keys, sshd does only allow ~/.ssh/authorized_keys with file permissions of user as owner and 0600. Typically umask is not setup this way.

– hargut
Jan 4 at 23:23













Please clarify (in your question) on which of each of the two machines you're running each step. You shouldn't be generating a private key on a server that's then used from a client, for example.

– roaima
Jan 4 at 23:23





Please clarify (in your question) on which of each of the two machines you're running each step. You shouldn't be generating a private key on a server that's then used from a client, for example.

– roaima
Jan 4 at 23:23










0






active

oldest

votes











Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
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: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
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%2funix.stackexchange.com%2fquestions%2f492586%2fssh-private-keys-fails-when-trying-to-login%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Unix & Linux Stack Exchange!


  • 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%2funix.stackexchange.com%2fquestions%2f492586%2fssh-private-keys-fails-when-trying-to-login%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

How to check contact read email or not when send email to Individual?

Bahrain

Postfix configuration issue with fips on centos 7; mailgun relay