Solve ssh public key login pop-up password input prompt

Source: Internet
Author: User

Solve ssh public key login pop-up password input prompt OS: centos 6.x because the disk space is not enough, mount/home to a large hard disk, then found that you cannot use a common account ssh login. New users cannot log on using ssh. The root account is normal. It is preliminarily determined that the permission problem is caused by mounting the/home directory. Debugging procedure: use root account to executechmod 755/home to create a user test, add authorized_keys under. ssh, and add the local public key. Useradd testchmod 700/home/testsu testcdmkdir. the sshchmod 700. sshadd your public key. ssh/authorized_keyschmod 600. ssh/authorized_keys try to log on with the ssh-vvvT test@myserver.com and view/var/log/secure .... jun 18 16:32:05 test sshd [1019]: debug1: trying public key file/home/test /. ssh/authorized_keysJun 18 16:32:05 test sshd [1019]: debug1: restore_uid: 0/0Jun 18 16:32:05 test sshd [1019]: Failed publickey for tes T from xx. xx port 36222 ssh2 okay, login failed... View/var/log/audit. log. Well, it's even more tragic, there is no record... (This problem is not done) view selinux execution getenforce, the status is Enforcingsetenforce 0 try, then ssh-vvvT test@myserver.com, succeeded! It must be related to selinux. Change selinux back first: setenforce 1 maybe home directory is badly labeled, restore/home directory label try restorecon-R-v/home then try ssh-vvvT test@myserver.com, succeeded! Done

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.