How to generate a .pem file for ssh?
I've added my ~/.ssh/id_rsa.pub
to my server's 'authorized_keys' file so I can do ssh user@myserver -p port
and login to the server successfully. Yet when I do
ssh-keygen -f id_rsa.pub -m 'PEM' -e > id_rsa.pem
and then use
ssh user@myserver -p port -i key.pem
I got:
Load key "key.pem": invalid format
user@myserver: Permission denied (publickey,gssapi-keyex,gssapi-with-mic)
ubuntu ssh
bumped to the homepage by Community♦ 9 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
I've added my ~/.ssh/id_rsa.pub
to my server's 'authorized_keys' file so I can do ssh user@myserver -p port
and login to the server successfully. Yet when I do
ssh-keygen -f id_rsa.pub -m 'PEM' -e > id_rsa.pem
and then use
ssh user@myserver -p port -i key.pem
I got:
Load key "key.pem": invalid format
user@myserver: Permission denied (publickey,gssapi-keyex,gssapi-with-mic)
ubuntu ssh
bumped to the homepage by Community♦ 9 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
2
You have a PEM public key and are trying to login with it? You need a private key for that (andssh-keygen -e -m PEM
always exports the public key)
– muru
Mar 19 '18 at 7:36
Ops... Let me give it a try tmr. Sorry.
– Aero Wang
Mar 19 '18 at 14:03
@muru You should post that as an answer, because... well, it's the answer :-)
– Philip Kendall
Mar 19 '18 at 21:03
add a comment |
I've added my ~/.ssh/id_rsa.pub
to my server's 'authorized_keys' file so I can do ssh user@myserver -p port
and login to the server successfully. Yet when I do
ssh-keygen -f id_rsa.pub -m 'PEM' -e > id_rsa.pem
and then use
ssh user@myserver -p port -i key.pem
I got:
Load key "key.pem": invalid format
user@myserver: Permission denied (publickey,gssapi-keyex,gssapi-with-mic)
ubuntu ssh
I've added my ~/.ssh/id_rsa.pub
to my server's 'authorized_keys' file so I can do ssh user@myserver -p port
and login to the server successfully. Yet when I do
ssh-keygen -f id_rsa.pub -m 'PEM' -e > id_rsa.pem
and then use
ssh user@myserver -p port -i key.pem
I got:
Load key "key.pem": invalid format
user@myserver: Permission denied (publickey,gssapi-keyex,gssapi-with-mic)
ubuntu ssh
ubuntu ssh
edited Mar 19 '18 at 10:15
Tomasz
9,53652965
9,53652965
asked Mar 19 '18 at 7:18
Aero WangAero Wang
1114
1114
bumped to the homepage by Community♦ 9 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
bumped to the homepage by Community♦ 9 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
2
You have a PEM public key and are trying to login with it? You need a private key for that (andssh-keygen -e -m PEM
always exports the public key)
– muru
Mar 19 '18 at 7:36
Ops... Let me give it a try tmr. Sorry.
– Aero Wang
Mar 19 '18 at 14:03
@muru You should post that as an answer, because... well, it's the answer :-)
– Philip Kendall
Mar 19 '18 at 21:03
add a comment |
2
You have a PEM public key and are trying to login with it? You need a private key for that (andssh-keygen -e -m PEM
always exports the public key)
– muru
Mar 19 '18 at 7:36
Ops... Let me give it a try tmr. Sorry.
– Aero Wang
Mar 19 '18 at 14:03
@muru You should post that as an answer, because... well, it's the answer :-)
– Philip Kendall
Mar 19 '18 at 21:03
2
2
You have a PEM public key and are trying to login with it? You need a private key for that (and
ssh-keygen -e -m PEM
always exports the public key)– muru
Mar 19 '18 at 7:36
You have a PEM public key and are trying to login with it? You need a private key for that (and
ssh-keygen -e -m PEM
always exports the public key)– muru
Mar 19 '18 at 7:36
Ops... Let me give it a try tmr. Sorry.
– Aero Wang
Mar 19 '18 at 14:03
Ops... Let me give it a try tmr. Sorry.
– Aero Wang
Mar 19 '18 at 14:03
@muru You should post that as an answer, because... well, it's the answer :-)
– Philip Kendall
Mar 19 '18 at 21:03
@muru You should post that as an answer, because... well, it's the answer :-)
– Philip Kendall
Mar 19 '18 at 21:03
add a comment |
1 Answer
1
active
oldest
votes
Don't use PEM. I don't see why you would want to do that. Perhaps expand your question with some logic?
You should do:
- ssh-keygen
- ssh-copy-id user@server
- ssh to server
add a comment |
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f432016%2fhow-to-generate-a-pem-file-for-ssh%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
Don't use PEM. I don't see why you would want to do that. Perhaps expand your question with some logic?
You should do:
- ssh-keygen
- ssh-copy-id user@server
- ssh to server
add a comment |
Don't use PEM. I don't see why you would want to do that. Perhaps expand your question with some logic?
You should do:
- ssh-keygen
- ssh-copy-id user@server
- ssh to server
add a comment |
Don't use PEM. I don't see why you would want to do that. Perhaps expand your question with some logic?
You should do:
- ssh-keygen
- ssh-copy-id user@server
- ssh to server
Don't use PEM. I don't see why you would want to do that. Perhaps expand your question with some logic?
You should do:
- ssh-keygen
- ssh-copy-id user@server
- ssh to server
answered Mar 19 '18 at 21:02
Timothy FrewTimothy Frew
21117
21117
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f432016%2fhow-to-generate-a-pem-file-for-ssh%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
2
You have a PEM public key and are trying to login with it? You need a private key for that (and
ssh-keygen -e -m PEM
always exports the public key)– muru
Mar 19 '18 at 7:36
Ops... Let me give it a try tmr. Sorry.
– Aero Wang
Mar 19 '18 at 14:03
@muru You should post that as an answer, because... well, it's the answer :-)
– Philip Kendall
Mar 19 '18 at 21:03