After change home directory, ask password with ssh

617 Views Asked by At

Just created a new user B on CentOS 6.8 and set public key of Ubuntu 16's user A to B's authorized_keys. Works fine. NOT ask password through ssh connection.

After change B's home directory (in /etc/passwd/ : /home/B > /user/B), ask B's password. Try to connect from A to B through SSH and permission is same on /home/B and /user/B.

Is sshd's default root path /home/?

1

There are 1 best solutions below

0
On

You didn't change the SELinux labels so the SELinux does not know that he should treat /user as /home. – Jakuje

Thanks a lot! Jakuje. You're right and solved problem.

  1. Open config - vi /etc/sysconfig/selinux
  2. Change value - SELINUX=disabled
  3. System reboot - shutdown -r now
  4. Check user home - cat /etc/passwd
  5. Try to connect with SSH