CentOS 7. SSH Permission denied. Why no password?












0















I have a frustrating SSH access problem on a new VM with Centos 7 which is driving me crazy!! It seems to be a first-time login problem on the new box.
I know all the basic settings ... this is about the 5th VM I have set up with this OS (So ifcfg.eth0, hostname, network etc is all good).
I can ping the new box as well ... remotely and from it to other boxes in the network. But ...
When I attempt remote SSH access I just keep getting the error:



Permission denied (publickey,gssapi-keyex,gssapi-with-mic)


I have seen this before and know about /etc/ssh/ssh_config ... and we are just talking password authentication here (not ssh key login). But only on this box I am getting it. I started off with just:



host *
GSSAPIAuthentication yes


This is what I used on the other machines and it always worked!
So, I have since tried uncommenting these keys:



#PasswordAuthentication yes


and



#PermitRootLogin yes


Above because I am logging in with root. And ... I also tried commenting out GSSAPIAuthentication. And yes ... I always restart the sshd daemon after making changes to this file (systemctl restart sshd.services)
Also ... I see nothing significant in /var/log/messages or /var/log/secure .. I've tried verbose using the ssh -v switch and what I do notice on this problem box is that shortly before the above "Permission denied" error is output I get this message:



debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic


Whereas on other boxes which work I always get this:



debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password


So clearly password authentication is not enabled !
The final straw is this: I get this same error message EVEN WHEN I SSH FROM THIS BOX TO ITSELF! There HAS to be some SSH setting I am missing.
Can someone please advise me what this setting is?










share|improve this question














bumped to the homepage by Community 1 hour ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
















  • Hi, and welcome. Did you restart sshd after modifying the configuration file?

    – Andy Dalton
    Aug 23 '18 at 14:18











  • Make sure you are writing those lines (PasswordAuthentication yes and PermitRootLogin yes) in /etc/ssh/sshd_config, and not the ssh_config. I notice you mentioning ssh_config in your question. If you are doing this right, it should work after restarting ssh service.

    – Vinod
    Aug 23 '18 at 14:50











  • Please edit your question to include the contents of your sshd_config file (or at least the relevant parts), instead of describing what's in it and what you changed.

    – Kenster
    Aug 23 '18 at 14:57











  • What is tbe exact command that you are using to log into the Centos 7 machine?

    – Nasir Riley
    Aug 23 '18 at 17:36











  • I am using this: ssh root@centoshost ... at least most of the time. But I have also used the -i switch to indicate path to pubkey. And of course the -v sometimes to get verbose

    – Paul Cartier
    Aug 23 '18 at 18:30


















0















I have a frustrating SSH access problem on a new VM with Centos 7 which is driving me crazy!! It seems to be a first-time login problem on the new box.
I know all the basic settings ... this is about the 5th VM I have set up with this OS (So ifcfg.eth0, hostname, network etc is all good).
I can ping the new box as well ... remotely and from it to other boxes in the network. But ...
When I attempt remote SSH access I just keep getting the error:



Permission denied (publickey,gssapi-keyex,gssapi-with-mic)


I have seen this before and know about /etc/ssh/ssh_config ... and we are just talking password authentication here (not ssh key login). But only on this box I am getting it. I started off with just:



host *
GSSAPIAuthentication yes


This is what I used on the other machines and it always worked!
So, I have since tried uncommenting these keys:



#PasswordAuthentication yes


and



#PermitRootLogin yes


Above because I am logging in with root. And ... I also tried commenting out GSSAPIAuthentication. And yes ... I always restart the sshd daemon after making changes to this file (systemctl restart sshd.services)
Also ... I see nothing significant in /var/log/messages or /var/log/secure .. I've tried verbose using the ssh -v switch and what I do notice on this problem box is that shortly before the above "Permission denied" error is output I get this message:



debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic


Whereas on other boxes which work I always get this:



debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password


So clearly password authentication is not enabled !
The final straw is this: I get this same error message EVEN WHEN I SSH FROM THIS BOX TO ITSELF! There HAS to be some SSH setting I am missing.
Can someone please advise me what this setting is?










share|improve this question














bumped to the homepage by Community 1 hour ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
















  • Hi, and welcome. Did you restart sshd after modifying the configuration file?

    – Andy Dalton
    Aug 23 '18 at 14:18











  • Make sure you are writing those lines (PasswordAuthentication yes and PermitRootLogin yes) in /etc/ssh/sshd_config, and not the ssh_config. I notice you mentioning ssh_config in your question. If you are doing this right, it should work after restarting ssh service.

    – Vinod
    Aug 23 '18 at 14:50











  • Please edit your question to include the contents of your sshd_config file (or at least the relevant parts), instead of describing what's in it and what you changed.

    – Kenster
    Aug 23 '18 at 14:57











  • What is tbe exact command that you are using to log into the Centos 7 machine?

    – Nasir Riley
    Aug 23 '18 at 17:36











  • I am using this: ssh root@centoshost ... at least most of the time. But I have also used the -i switch to indicate path to pubkey. And of course the -v sometimes to get verbose

    – Paul Cartier
    Aug 23 '18 at 18:30
















0












0








0








I have a frustrating SSH access problem on a new VM with Centos 7 which is driving me crazy!! It seems to be a first-time login problem on the new box.
I know all the basic settings ... this is about the 5th VM I have set up with this OS (So ifcfg.eth0, hostname, network etc is all good).
I can ping the new box as well ... remotely and from it to other boxes in the network. But ...
When I attempt remote SSH access I just keep getting the error:



Permission denied (publickey,gssapi-keyex,gssapi-with-mic)


I have seen this before and know about /etc/ssh/ssh_config ... and we are just talking password authentication here (not ssh key login). But only on this box I am getting it. I started off with just:



host *
GSSAPIAuthentication yes


This is what I used on the other machines and it always worked!
So, I have since tried uncommenting these keys:



#PasswordAuthentication yes


and



#PermitRootLogin yes


Above because I am logging in with root. And ... I also tried commenting out GSSAPIAuthentication. And yes ... I always restart the sshd daemon after making changes to this file (systemctl restart sshd.services)
Also ... I see nothing significant in /var/log/messages or /var/log/secure .. I've tried verbose using the ssh -v switch and what I do notice on this problem box is that shortly before the above "Permission denied" error is output I get this message:



debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic


Whereas on other boxes which work I always get this:



debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password


So clearly password authentication is not enabled !
The final straw is this: I get this same error message EVEN WHEN I SSH FROM THIS BOX TO ITSELF! There HAS to be some SSH setting I am missing.
Can someone please advise me what this setting is?










share|improve this question














I have a frustrating SSH access problem on a new VM with Centos 7 which is driving me crazy!! It seems to be a first-time login problem on the new box.
I know all the basic settings ... this is about the 5th VM I have set up with this OS (So ifcfg.eth0, hostname, network etc is all good).
I can ping the new box as well ... remotely and from it to other boxes in the network. But ...
When I attempt remote SSH access I just keep getting the error:



Permission denied (publickey,gssapi-keyex,gssapi-with-mic)


I have seen this before and know about /etc/ssh/ssh_config ... and we are just talking password authentication here (not ssh key login). But only on this box I am getting it. I started off with just:



host *
GSSAPIAuthentication yes


This is what I used on the other machines and it always worked!
So, I have since tried uncommenting these keys:



#PasswordAuthentication yes


and



#PermitRootLogin yes


Above because I am logging in with root. And ... I also tried commenting out GSSAPIAuthentication. And yes ... I always restart the sshd daemon after making changes to this file (systemctl restart sshd.services)
Also ... I see nothing significant in /var/log/messages or /var/log/secure .. I've tried verbose using the ssh -v switch and what I do notice on this problem box is that shortly before the above "Permission denied" error is output I get this message:



debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic


Whereas on other boxes which work I always get this:



debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password


So clearly password authentication is not enabled !
The final straw is this: I get this same error message EVEN WHEN I SSH FROM THIS BOX TO ITSELF! There HAS to be some SSH setting I am missing.
Can someone please advise me what this setting is?







centos sshd






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Aug 23 '18 at 13:57









Paul CartierPaul Cartier

11




11





bumped to the homepage by Community 1 hour 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 1 hour ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.















  • Hi, and welcome. Did you restart sshd after modifying the configuration file?

    – Andy Dalton
    Aug 23 '18 at 14:18











  • Make sure you are writing those lines (PasswordAuthentication yes and PermitRootLogin yes) in /etc/ssh/sshd_config, and not the ssh_config. I notice you mentioning ssh_config in your question. If you are doing this right, it should work after restarting ssh service.

    – Vinod
    Aug 23 '18 at 14:50











  • Please edit your question to include the contents of your sshd_config file (or at least the relevant parts), instead of describing what's in it and what you changed.

    – Kenster
    Aug 23 '18 at 14:57











  • What is tbe exact command that you are using to log into the Centos 7 machine?

    – Nasir Riley
    Aug 23 '18 at 17:36











  • I am using this: ssh root@centoshost ... at least most of the time. But I have also used the -i switch to indicate path to pubkey. And of course the -v sometimes to get verbose

    – Paul Cartier
    Aug 23 '18 at 18:30





















  • Hi, and welcome. Did you restart sshd after modifying the configuration file?

    – Andy Dalton
    Aug 23 '18 at 14:18











  • Make sure you are writing those lines (PasswordAuthentication yes and PermitRootLogin yes) in /etc/ssh/sshd_config, and not the ssh_config. I notice you mentioning ssh_config in your question. If you are doing this right, it should work after restarting ssh service.

    – Vinod
    Aug 23 '18 at 14:50











  • Please edit your question to include the contents of your sshd_config file (or at least the relevant parts), instead of describing what's in it and what you changed.

    – Kenster
    Aug 23 '18 at 14:57











  • What is tbe exact command that you are using to log into the Centos 7 machine?

    – Nasir Riley
    Aug 23 '18 at 17:36











  • I am using this: ssh root@centoshost ... at least most of the time. But I have also used the -i switch to indicate path to pubkey. And of course the -v sometimes to get verbose

    – Paul Cartier
    Aug 23 '18 at 18:30



















Hi, and welcome. Did you restart sshd after modifying the configuration file?

– Andy Dalton
Aug 23 '18 at 14:18





Hi, and welcome. Did you restart sshd after modifying the configuration file?

– Andy Dalton
Aug 23 '18 at 14:18













Make sure you are writing those lines (PasswordAuthentication yes and PermitRootLogin yes) in /etc/ssh/sshd_config, and not the ssh_config. I notice you mentioning ssh_config in your question. If you are doing this right, it should work after restarting ssh service.

– Vinod
Aug 23 '18 at 14:50





Make sure you are writing those lines (PasswordAuthentication yes and PermitRootLogin yes) in /etc/ssh/sshd_config, and not the ssh_config. I notice you mentioning ssh_config in your question. If you are doing this right, it should work after restarting ssh service.

– Vinod
Aug 23 '18 at 14:50













Please edit your question to include the contents of your sshd_config file (or at least the relevant parts), instead of describing what's in it and what you changed.

– Kenster
Aug 23 '18 at 14:57





Please edit your question to include the contents of your sshd_config file (or at least the relevant parts), instead of describing what's in it and what you changed.

– Kenster
Aug 23 '18 at 14:57













What is tbe exact command that you are using to log into the Centos 7 machine?

– Nasir Riley
Aug 23 '18 at 17:36





What is tbe exact command that you are using to log into the Centos 7 machine?

– Nasir Riley
Aug 23 '18 at 17:36













I am using this: ssh root@centoshost ... at least most of the time. But I have also used the -i switch to indicate path to pubkey. And of course the -v sometimes to get verbose

– Paul Cartier
Aug 23 '18 at 18:30







I am using this: ssh root@centoshost ... at least most of the time. But I have also used the -i switch to indicate path to pubkey. And of course the -v sometimes to get verbose

– Paul Cartier
Aug 23 '18 at 18:30












1 Answer
1






active

oldest

votes


















0














You commented out the password authentication. Therefore, openSSH is not accepting passwords as an authentication measure. The same applies to root login.



Remove the # on the lines



PasswordAuthentication yes
PermitRootLogin yes


Then restart the service.






share|improve this answer
























  • I did uncomment them. See above: "I have since tried uncommenting these keys:" And .. I did restart sshd ... also above "And yes ... I always restart the sshd daemon after making changes to this file" In fact I've started sshd, networking and the entire VM many many times :-)

    – Paul Cartier
    Aug 23 '18 at 14:24











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%2f464409%2fcentos-7-ssh-permission-denied-why-no-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









0














You commented out the password authentication. Therefore, openSSH is not accepting passwords as an authentication measure. The same applies to root login.



Remove the # on the lines



PasswordAuthentication yes
PermitRootLogin yes


Then restart the service.






share|improve this answer
























  • I did uncomment them. See above: "I have since tried uncommenting these keys:" And .. I did restart sshd ... also above "And yes ... I always restart the sshd daemon after making changes to this file" In fact I've started sshd, networking and the entire VM many many times :-)

    – Paul Cartier
    Aug 23 '18 at 14:24
















0














You commented out the password authentication. Therefore, openSSH is not accepting passwords as an authentication measure. The same applies to root login.



Remove the # on the lines



PasswordAuthentication yes
PermitRootLogin yes


Then restart the service.






share|improve this answer
























  • I did uncomment them. See above: "I have since tried uncommenting these keys:" And .. I did restart sshd ... also above "And yes ... I always restart the sshd daemon after making changes to this file" In fact I've started sshd, networking and the entire VM many many times :-)

    – Paul Cartier
    Aug 23 '18 at 14:24














0












0








0







You commented out the password authentication. Therefore, openSSH is not accepting passwords as an authentication measure. The same applies to root login.



Remove the # on the lines



PasswordAuthentication yes
PermitRootLogin yes


Then restart the service.






share|improve this answer













You commented out the password authentication. Therefore, openSSH is not accepting passwords as an authentication measure. The same applies to root login.



Remove the # on the lines



PasswordAuthentication yes
PermitRootLogin yes


Then restart the service.







share|improve this answer












share|improve this answer



share|improve this answer










answered Aug 23 '18 at 14:20









PankiPanki

694311




694311













  • I did uncomment them. See above: "I have since tried uncommenting these keys:" And .. I did restart sshd ... also above "And yes ... I always restart the sshd daemon after making changes to this file" In fact I've started sshd, networking and the entire VM many many times :-)

    – Paul Cartier
    Aug 23 '18 at 14:24



















  • I did uncomment them. See above: "I have since tried uncommenting these keys:" And .. I did restart sshd ... also above "And yes ... I always restart the sshd daemon after making changes to this file" In fact I've started sshd, networking and the entire VM many many times :-)

    – Paul Cartier
    Aug 23 '18 at 14:24

















I did uncomment them. See above: "I have since tried uncommenting these keys:" And .. I did restart sshd ... also above "And yes ... I always restart the sshd daemon after making changes to this file" In fact I've started sshd, networking and the entire VM many many times :-)

– Paul Cartier
Aug 23 '18 at 14:24





I did uncomment them. See above: "I have since tried uncommenting these keys:" And .. I did restart sshd ... also above "And yes ... I always restart the sshd daemon after making changes to this file" In fact I've started sshd, networking and the entire VM many many times :-)

– Paul Cartier
Aug 23 '18 at 14:24


















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%2f464409%2fcentos-7-ssh-permission-denied-why-no-password%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

CARDNET

Boot-repair Failure: Unable to locate package grub-common:i386

濃尾地震