To use ssh-id-copy do you need both id_rsa.pub and id_rsa?

Multi tool use
I am trying to setup a second access ssh key for a friend. He sent me his id_rsa.pub.
ssh-copy-id -i id_rsa.pub root@123.123.123.123
/usr/local/bin/ssh-copy-id: ERROR: failed to open ID file './id_rsa': No such file or directory
Do I need him to send me both files?
linux centos ssh ssh-keys
migrated from serverfault.com Feb 6 '15 at 8:15
This question came from our site for system and network administrators.
add a comment |
I am trying to setup a second access ssh key for a friend. He sent me his id_rsa.pub.
ssh-copy-id -i id_rsa.pub root@123.123.123.123
/usr/local/bin/ssh-copy-id: ERROR: failed to open ID file './id_rsa': No such file or directory
Do I need him to send me both files?
linux centos ssh ssh-keys
migrated from serverfault.com Feb 6 '15 at 8:15
This question came from our site for system and network administrators.
1
The .pub is sufficient. And keep in mind that you always keep your private key secrete (at all times!). To add a new key you can simple append the content of .pub to your authorized_keys.
– deagh
Feb 6 '15 at 7:04
2
@deaghYou don't need to keep a private key secret, you need to keep it secure.
– Iain
Feb 6 '15 at 7:20
The ssh-copy-id script here doesn't appear to emit that particular error message. I notice your ssh-copy-id script is in /usr/local/bin. It may be different from the commonly-used version of the command.
– Kenster
Feb 6 '15 at 16:19
add a comment |
I am trying to setup a second access ssh key for a friend. He sent me his id_rsa.pub.
ssh-copy-id -i id_rsa.pub root@123.123.123.123
/usr/local/bin/ssh-copy-id: ERROR: failed to open ID file './id_rsa': No such file or directory
Do I need him to send me both files?
linux centos ssh ssh-keys
I am trying to setup a second access ssh key for a friend. He sent me his id_rsa.pub.
ssh-copy-id -i id_rsa.pub root@123.123.123.123
/usr/local/bin/ssh-copy-id: ERROR: failed to open ID file './id_rsa': No such file or directory
Do I need him to send me both files?
linux centos ssh ssh-keys
linux centos ssh ssh-keys
asked Feb 6 '15 at 6:30
user269023
migrated from serverfault.com Feb 6 '15 at 8:15
This question came from our site for system and network administrators.
migrated from serverfault.com Feb 6 '15 at 8:15
This question came from our site for system and network administrators.
1
The .pub is sufficient. And keep in mind that you always keep your private key secrete (at all times!). To add a new key you can simple append the content of .pub to your authorized_keys.
– deagh
Feb 6 '15 at 7:04
2
@deaghYou don't need to keep a private key secret, you need to keep it secure.
– Iain
Feb 6 '15 at 7:20
The ssh-copy-id script here doesn't appear to emit that particular error message. I notice your ssh-copy-id script is in /usr/local/bin. It may be different from the commonly-used version of the command.
– Kenster
Feb 6 '15 at 16:19
add a comment |
1
The .pub is sufficient. And keep in mind that you always keep your private key secrete (at all times!). To add a new key you can simple append the content of .pub to your authorized_keys.
– deagh
Feb 6 '15 at 7:04
2
@deaghYou don't need to keep a private key secret, you need to keep it secure.
– Iain
Feb 6 '15 at 7:20
The ssh-copy-id script here doesn't appear to emit that particular error message. I notice your ssh-copy-id script is in /usr/local/bin. It may be different from the commonly-used version of the command.
– Kenster
Feb 6 '15 at 16:19
1
1
The .pub is sufficient. And keep in mind that you always keep your private key secrete (at all times!). To add a new key you can simple append the content of .pub to your authorized_keys.
– deagh
Feb 6 '15 at 7:04
The .pub is sufficient. And keep in mind that you always keep your private key secrete (at all times!). To add a new key you can simple append the content of .pub to your authorized_keys.
– deagh
Feb 6 '15 at 7:04
2
2
@deaghYou don't need to keep a private key secret, you need to keep it secure.
– Iain
Feb 6 '15 at 7:20
@deaghYou don't need to keep a private key secret, you need to keep it secure.
– Iain
Feb 6 '15 at 7:20
The ssh-copy-id script here doesn't appear to emit that particular error message. I notice your ssh-copy-id script is in /usr/local/bin. It may be different from the commonly-used version of the command.
– Kenster
Feb 6 '15 at 16:19
The ssh-copy-id script here doesn't appear to emit that particular error message. I notice your ssh-copy-id script is in /usr/local/bin. It may be different from the commonly-used version of the command.
– Kenster
Feb 6 '15 at 16:19
add a comment |
5 Answers
5
active
oldest
votes
The ssh-copy-id
command from OpenSSH fails if there is no private key file with the same name available, because it tries to login with the specified key to check if it is already present on the remote server.
In recent versions you can override this behavior with the -f
switch ("Forced mode").
From the man page:
-f
Forced mode: doesn't check if the keys are present on the
remote server. This means that it does not need the private key. Of
course, this can result in more than one copy of the key being installed
on the remote system.
add a comment |
The .pub
is sufficient. You are not in the correct folder.
You can try this :
ssh-copy-id -i /root/.ssh/id_rsa.pub root@123.123.123.123
(for the root user : not recommended, it's just an example).
This file is under the .ssh
folder on the user folder.
2
On mac it needs the-f
if you don't have the private key as well, I think
– Stevie G
Aug 6 '16 at 9:54
add a comment |
This has been reported as OpenSSH bug #2110.
add a comment |
As mentioned here this is a bug.
Anyway you can simply create an empty file to make it work. In your case:
$ touch ./id_rsa
$ ssh-copy-id -i id_rsa.pub root@123.123.123.123
I had the same issue and this worked for me 👍
add a comment |
it works for me the question is when it ask "Enter file in which to save the key (/Users/xiaoyu/.ssh/id_rsa):" u should type id_rsa
and use commande "ssh-copy-id -i ~/.ssh/id_rsa.pub polytech@192.168.0.102"
add a comment |
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
});
}
});
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%2fsuperuser.com%2fquestions%2f874406%2fto-use-ssh-id-copy-do-you-need-both-id-rsa-pub-and-id-rsa%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
5 Answers
5
active
oldest
votes
5 Answers
5
active
oldest
votes
active
oldest
votes
active
oldest
votes
The ssh-copy-id
command from OpenSSH fails if there is no private key file with the same name available, because it tries to login with the specified key to check if it is already present on the remote server.
In recent versions you can override this behavior with the -f
switch ("Forced mode").
From the man page:
-f
Forced mode: doesn't check if the keys are present on the
remote server. This means that it does not need the private key. Of
course, this can result in more than one copy of the key being installed
on the remote system.
add a comment |
The ssh-copy-id
command from OpenSSH fails if there is no private key file with the same name available, because it tries to login with the specified key to check if it is already present on the remote server.
In recent versions you can override this behavior with the -f
switch ("Forced mode").
From the man page:
-f
Forced mode: doesn't check if the keys are present on the
remote server. This means that it does not need the private key. Of
course, this can result in more than one copy of the key being installed
on the remote system.
add a comment |
The ssh-copy-id
command from OpenSSH fails if there is no private key file with the same name available, because it tries to login with the specified key to check if it is already present on the remote server.
In recent versions you can override this behavior with the -f
switch ("Forced mode").
From the man page:
-f
Forced mode: doesn't check if the keys are present on the
remote server. This means that it does not need the private key. Of
course, this can result in more than one copy of the key being installed
on the remote system.
The ssh-copy-id
command from OpenSSH fails if there is no private key file with the same name available, because it tries to login with the specified key to check if it is already present on the remote server.
In recent versions you can override this behavior with the -f
switch ("Forced mode").
From the man page:
-f
Forced mode: doesn't check if the keys are present on the
remote server. This means that it does not need the private key. Of
course, this can result in more than one copy of the key being installed
on the remote system.
edited Jan 13 at 2:44
Scott
15.7k113890
15.7k113890
answered Jun 10 '16 at 18:26
Dario SeidlDario Seidl
2,14611318
2,14611318
add a comment |
add a comment |
The .pub
is sufficient. You are not in the correct folder.
You can try this :
ssh-copy-id -i /root/.ssh/id_rsa.pub root@123.123.123.123
(for the root user : not recommended, it's just an example).
This file is under the .ssh
folder on the user folder.
2
On mac it needs the-f
if you don't have the private key as well, I think
– Stevie G
Aug 6 '16 at 9:54
add a comment |
The .pub
is sufficient. You are not in the correct folder.
You can try this :
ssh-copy-id -i /root/.ssh/id_rsa.pub root@123.123.123.123
(for the root user : not recommended, it's just an example).
This file is under the .ssh
folder on the user folder.
2
On mac it needs the-f
if you don't have the private key as well, I think
– Stevie G
Aug 6 '16 at 9:54
add a comment |
The .pub
is sufficient. You are not in the correct folder.
You can try this :
ssh-copy-id -i /root/.ssh/id_rsa.pub root@123.123.123.123
(for the root user : not recommended, it's just an example).
This file is under the .ssh
folder on the user folder.
The .pub
is sufficient. You are not in the correct folder.
You can try this :
ssh-copy-id -i /root/.ssh/id_rsa.pub root@123.123.123.123
(for the root user : not recommended, it's just an example).
This file is under the .ssh
folder on the user folder.
edited Mar 19 '16 at 8:15


Stevie G
1153317
1153317
answered Feb 6 '15 at 14:10
Jérémy MunozJérémy Munoz
1591
1591
2
On mac it needs the-f
if you don't have the private key as well, I think
– Stevie G
Aug 6 '16 at 9:54
add a comment |
2
On mac it needs the-f
if you don't have the private key as well, I think
– Stevie G
Aug 6 '16 at 9:54
2
2
On mac it needs the
-f
if you don't have the private key as well, I think– Stevie G
Aug 6 '16 at 9:54
On mac it needs the
-f
if you don't have the private key as well, I think– Stevie G
Aug 6 '16 at 9:54
add a comment |
This has been reported as OpenSSH bug #2110.
add a comment |
This has been reported as OpenSSH bug #2110.
add a comment |
This has been reported as OpenSSH bug #2110.
This has been reported as OpenSSH bug #2110.
answered Feb 16 '16 at 0:01
Mihai CapotăMihai Capotă
633711
633711
add a comment |
add a comment |
As mentioned here this is a bug.
Anyway you can simply create an empty file to make it work. In your case:
$ touch ./id_rsa
$ ssh-copy-id -i id_rsa.pub root@123.123.123.123
I had the same issue and this worked for me 👍
add a comment |
As mentioned here this is a bug.
Anyway you can simply create an empty file to make it work. In your case:
$ touch ./id_rsa
$ ssh-copy-id -i id_rsa.pub root@123.123.123.123
I had the same issue and this worked for me 👍
add a comment |
As mentioned here this is a bug.
Anyway you can simply create an empty file to make it work. In your case:
$ touch ./id_rsa
$ ssh-copy-id -i id_rsa.pub root@123.123.123.123
I had the same issue and this worked for me 👍
As mentioned here this is a bug.
Anyway you can simply create an empty file to make it work. In your case:
$ touch ./id_rsa
$ ssh-copy-id -i id_rsa.pub root@123.123.123.123
I had the same issue and this worked for me 👍
answered Nov 6 '17 at 11:22
jawirajawira
1111
1111
add a comment |
add a comment |
it works for me the question is when it ask "Enter file in which to save the key (/Users/xiaoyu/.ssh/id_rsa):" u should type id_rsa
and use commande "ssh-copy-id -i ~/.ssh/id_rsa.pub polytech@192.168.0.102"
add a comment |
it works for me the question is when it ask "Enter file in which to save the key (/Users/xiaoyu/.ssh/id_rsa):" u should type id_rsa
and use commande "ssh-copy-id -i ~/.ssh/id_rsa.pub polytech@192.168.0.102"
add a comment |
it works for me the question is when it ask "Enter file in which to save the key (/Users/xiaoyu/.ssh/id_rsa):" u should type id_rsa
and use commande "ssh-copy-id -i ~/.ssh/id_rsa.pub polytech@192.168.0.102"
it works for me the question is when it ask "Enter file in which to save the key (/Users/xiaoyu/.ssh/id_rsa):" u should type id_rsa
and use commande "ssh-copy-id -i ~/.ssh/id_rsa.pub polytech@192.168.0.102"
answered Jan 13 at 0:14
user984431user984431
1
1
add a comment |
add a comment |
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.
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%2fsuperuser.com%2fquestions%2f874406%2fto-use-ssh-id-copy-do-you-need-both-id-rsa-pub-and-id-rsa%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
9 YlgNoF,34ALneR IRLQOsxTUivKv5W,DraDDR8YjpcGFHzQ0b,ofcpkNk
1
The .pub is sufficient. And keep in mind that you always keep your private key secrete (at all times!). To add a new key you can simple append the content of .pub to your authorized_keys.
– deagh
Feb 6 '15 at 7:04
2
@deaghYou don't need to keep a private key secret, you need to keep it secure.
– Iain
Feb 6 '15 at 7:20
The ssh-copy-id script here doesn't appear to emit that particular error message. I notice your ssh-copy-id script is in /usr/local/bin. It may be different from the commonly-used version of the command.
– Kenster
Feb 6 '15 at 16:19