ssh-copy-id ask for password
I created user and generated key with this commands
root# mkdir /usr/share/foreman/.ssh
root# chmod 700 /usr/share/foreman/.ssh
root# chown user:user/usr/share/foreman/.ssh
root# su user -s /bin/bash
user$ ssh-keygen
And then tryed to copy key (on same server) between user and root
user$ ssh-copy-id root@hostname.com
user$ ssh root@hostname.com
But when tryint to ssh-copy-id
root is asking for password. Don't know why.
Found on internet commenting UsePAM can fix the issue, but did not worked for me.
#UsePAM yes
I have also in my sshd_config this option allowed
PasswordAuthentication yes
ssh users
add a comment |
I created user and generated key with this commands
root# mkdir /usr/share/foreman/.ssh
root# chmod 700 /usr/share/foreman/.ssh
root# chown user:user/usr/share/foreman/.ssh
root# su user -s /bin/bash
user$ ssh-keygen
And then tryed to copy key (on same server) between user and root
user$ ssh-copy-id root@hostname.com
user$ ssh root@hostname.com
But when tryint to ssh-copy-id
root is asking for password. Don't know why.
Found on internet commenting UsePAM can fix the issue, but did not worked for me.
#UsePAM yes
I have also in my sshd_config this option allowed
PasswordAuthentication yes
ssh users
add a comment |
I created user and generated key with this commands
root# mkdir /usr/share/foreman/.ssh
root# chmod 700 /usr/share/foreman/.ssh
root# chown user:user/usr/share/foreman/.ssh
root# su user -s /bin/bash
user$ ssh-keygen
And then tryed to copy key (on same server) between user and root
user$ ssh-copy-id root@hostname.com
user$ ssh root@hostname.com
But when tryint to ssh-copy-id
root is asking for password. Don't know why.
Found on internet commenting UsePAM can fix the issue, but did not worked for me.
#UsePAM yes
I have also in my sshd_config this option allowed
PasswordAuthentication yes
ssh users
I created user and generated key with this commands
root# mkdir /usr/share/foreman/.ssh
root# chmod 700 /usr/share/foreman/.ssh
root# chown user:user/usr/share/foreman/.ssh
root# su user -s /bin/bash
user$ ssh-keygen
And then tryed to copy key (on same server) between user and root
user$ ssh-copy-id root@hostname.com
user$ ssh root@hostname.com
But when tryint to ssh-copy-id
root is asking for password. Don't know why.
Found on internet commenting UsePAM can fix the issue, but did not worked for me.
#UsePAM yes
I have also in my sshd_config this option allowed
PasswordAuthentication yes
ssh users
ssh users
edited yesterday
steeldriver
34.6k35083
34.6k35083
asked yesterday
Delirium
7818
7818
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
The command
ssh-copy-id root@hostname.com
works by SSHing into the server and copying your SSH public key(s) to ~/.ssh/authorized_keys
. If you don't already have public-key authentication, you will be asked for a password when SSHing into the server during this.
New contributor
Problem is when I use password it wont accept it, even it's really proper one.
– Delirium
yesterday
1
You're trying to log into root with a password, by default this isn't allowed. On the server in/etc/ssh/sshd_config
, what isPermitRootLogin
set to?
– steeling
yesterday
there is commented#PermitRootLogin prohibit-password
– Delirium
yesterday
1
The default value isprohibit-password
. This means that SSHing into a server as root is allowed, but password authentication is explicitly not allowed. Either you can change this tono
(NOT recommended), or you can manually copy the public key part of your key (ending in.pub
) into/root/.ssh/authorized_keys
on the server.
– steeling
yesterday
Thank you for advice. Interesting is that, I tryed to login from differend machine and usessh-copy-id
and it worked. It's seems like not working only for that specific user.
– Delirium
yesterday
|
show 3 more comments
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%2f492484%2fssh-copy-id-ask-for-password%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
The command
ssh-copy-id root@hostname.com
works by SSHing into the server and copying your SSH public key(s) to ~/.ssh/authorized_keys
. If you don't already have public-key authentication, you will be asked for a password when SSHing into the server during this.
New contributor
Problem is when I use password it wont accept it, even it's really proper one.
– Delirium
yesterday
1
You're trying to log into root with a password, by default this isn't allowed. On the server in/etc/ssh/sshd_config
, what isPermitRootLogin
set to?
– steeling
yesterday
there is commented#PermitRootLogin prohibit-password
– Delirium
yesterday
1
The default value isprohibit-password
. This means that SSHing into a server as root is allowed, but password authentication is explicitly not allowed. Either you can change this tono
(NOT recommended), or you can manually copy the public key part of your key (ending in.pub
) into/root/.ssh/authorized_keys
on the server.
– steeling
yesterday
Thank you for advice. Interesting is that, I tryed to login from differend machine and usessh-copy-id
and it worked. It's seems like not working only for that specific user.
– Delirium
yesterday
|
show 3 more comments
The command
ssh-copy-id root@hostname.com
works by SSHing into the server and copying your SSH public key(s) to ~/.ssh/authorized_keys
. If you don't already have public-key authentication, you will be asked for a password when SSHing into the server during this.
New contributor
Problem is when I use password it wont accept it, even it's really proper one.
– Delirium
yesterday
1
You're trying to log into root with a password, by default this isn't allowed. On the server in/etc/ssh/sshd_config
, what isPermitRootLogin
set to?
– steeling
yesterday
there is commented#PermitRootLogin prohibit-password
– Delirium
yesterday
1
The default value isprohibit-password
. This means that SSHing into a server as root is allowed, but password authentication is explicitly not allowed. Either you can change this tono
(NOT recommended), or you can manually copy the public key part of your key (ending in.pub
) into/root/.ssh/authorized_keys
on the server.
– steeling
yesterday
Thank you for advice. Interesting is that, I tryed to login from differend machine and usessh-copy-id
and it worked. It's seems like not working only for that specific user.
– Delirium
yesterday
|
show 3 more comments
The command
ssh-copy-id root@hostname.com
works by SSHing into the server and copying your SSH public key(s) to ~/.ssh/authorized_keys
. If you don't already have public-key authentication, you will be asked for a password when SSHing into the server during this.
New contributor
The command
ssh-copy-id root@hostname.com
works by SSHing into the server and copying your SSH public key(s) to ~/.ssh/authorized_keys
. If you don't already have public-key authentication, you will be asked for a password when SSHing into the server during this.
New contributor
New contributor
answered yesterday
steeling
715
715
New contributor
New contributor
Problem is when I use password it wont accept it, even it's really proper one.
– Delirium
yesterday
1
You're trying to log into root with a password, by default this isn't allowed. On the server in/etc/ssh/sshd_config
, what isPermitRootLogin
set to?
– steeling
yesterday
there is commented#PermitRootLogin prohibit-password
– Delirium
yesterday
1
The default value isprohibit-password
. This means that SSHing into a server as root is allowed, but password authentication is explicitly not allowed. Either you can change this tono
(NOT recommended), or you can manually copy the public key part of your key (ending in.pub
) into/root/.ssh/authorized_keys
on the server.
– steeling
yesterday
Thank you for advice. Interesting is that, I tryed to login from differend machine and usessh-copy-id
and it worked. It's seems like not working only for that specific user.
– Delirium
yesterday
|
show 3 more comments
Problem is when I use password it wont accept it, even it's really proper one.
– Delirium
yesterday
1
You're trying to log into root with a password, by default this isn't allowed. On the server in/etc/ssh/sshd_config
, what isPermitRootLogin
set to?
– steeling
yesterday
there is commented#PermitRootLogin prohibit-password
– Delirium
yesterday
1
The default value isprohibit-password
. This means that SSHing into a server as root is allowed, but password authentication is explicitly not allowed. Either you can change this tono
(NOT recommended), or you can manually copy the public key part of your key (ending in.pub
) into/root/.ssh/authorized_keys
on the server.
– steeling
yesterday
Thank you for advice. Interesting is that, I tryed to login from differend machine and usessh-copy-id
and it worked. It's seems like not working only for that specific user.
– Delirium
yesterday
Problem is when I use password it wont accept it, even it's really proper one.
– Delirium
yesterday
Problem is when I use password it wont accept it, even it's really proper one.
– Delirium
yesterday
1
1
You're trying to log into root with a password, by default this isn't allowed. On the server in
/etc/ssh/sshd_config
, what is PermitRootLogin
set to?– steeling
yesterday
You're trying to log into root with a password, by default this isn't allowed. On the server in
/etc/ssh/sshd_config
, what is PermitRootLogin
set to?– steeling
yesterday
there is commented
#PermitRootLogin prohibit-password
– Delirium
yesterday
there is commented
#PermitRootLogin prohibit-password
– Delirium
yesterday
1
1
The default value is
prohibit-password
. This means that SSHing into a server as root is allowed, but password authentication is explicitly not allowed. Either you can change this to no
(NOT recommended), or you can manually copy the public key part of your key (ending in .pub
) into /root/.ssh/authorized_keys
on the server.– steeling
yesterday
The default value is
prohibit-password
. This means that SSHing into a server as root is allowed, but password authentication is explicitly not allowed. Either you can change this to no
(NOT recommended), or you can manually copy the public key part of your key (ending in .pub
) into /root/.ssh/authorized_keys
on the server.– steeling
yesterday
Thank you for advice. Interesting is that, I tryed to login from differend machine and use
ssh-copy-id
and it worked. It's seems like not working only for that specific user.– Delirium
yesterday
Thank you for advice. Interesting is that, I tryed to login from differend machine and use
ssh-copy-id
and it worked. It's seems like not working only for that specific user.– Delirium
yesterday
|
show 3 more comments
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.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- 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%2f492484%2fssh-copy-id-ask-for-password%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