SSH key failed to debug

Source: Internet
Author: User

Environment Description:

1. CentOS 6.x system, using the root account to set the secret key mode login;

2. When configuring multiple host keys, partial success, partial unsuccessful;

3. Security log/var/log/secure has been closed, no records;

4./etc/selinux/config in selinux=disabled.

This problem plagued a relatively long time, from the Internet search, most of the problem is said permission, but I have set the permissions,

Configuration file/etc/ssh/sshd_config is the same, there is no reason some hosts can log in, some can not login ah,

Permissions View:

ll-d. ssh/

DRW-------2 root root 4096 Dec 6 15:33. ssh/

LL. Ssh/authorized_keys

-RW-------1 root root 666 Dec 6 13:08. Ssh/authorized_keys

If not, you can set this:

chmod. ssh/

chmod. Ssh/authorized_keys

Problem solving:

The problem was later detected by the-d parameter of ssh ,

Server-side open temporary port and debug debug information:

/usr/sbin/sshd-p 10022-d

Client Links:

Ssh-p 10022 [email protected]

Service-Side output:


Debug1:trying Public Key File/root/.ssh/authorized_keys

DEBUG1:FD 4 Clearing O_nonblock

Authentication Refused:bad ownership or modes for Directory/root


The above red font description is the/root directory permissions problem, boarded the view, sure enough, the permissions are not correct, modified to 755:

chmod 755/root/

Log in again, everything is OK.

This article is from the top leaderboard blog, so be sure to keep this source

SSH key failed to debug

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.