CenOS6.3 SSH Public key authentication error: Permission denied (publickey,gssapi-keyex,gssapi-with-mic)

Source: Internet
Author: User

Reprinted from http://laowafang.blog.51cto.com/251518/1364298

1. Description:

SSH password user remote login, has been using the Debian operating system, the user directory permission requirements have not been concerned about, generated a key, lil bit location directly can be used, today test ansible tools, Used to CentOS6.3 found it to the directory permission requirements are relatively strict, this blog only record this permission modification operation.

2. Operation Record

(1) Create User: Ansible

(2) Modify the Sshd_config file

# Vi/etc/ssh/sshd_config//Open the following

Hostkey/etc/ssh/ssh_host_rsa_key

Rsaauthentication Yes

Pubkeyauthentication Yes

Authorizedkeysfile. Ssh/authorized_keys

#/etc/init.d/sshd Restart

(3) Permission settings

# MKDIR/HOME/ANSIBLE/.SSH

# Chown-r Ansible:ansible/home/ansible

# chmod 700/home/ansible

# chmod 700/home/ansible/.ssh

# chmod all permissions for 644/home/ansible/.ssh/authorized_keys//public key file

# chmod all permissions for 600/HOME/ANSIBLE/.SSH/ID_RSA//private key files

# # # can test the remote connection ...

CenOS6.3 SSH Public key authentication error: Permission denied (publickey,gssapi-keyex,gssapi-with-mic)

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: info-contact@alibabacloud.com 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.