I continue to encounter an issue moving my home directory to a new disk on a CentOS VM on Azure. On creation the server is configured to use a SSH key for authentication and the "no password" option is set. After I add the new disk, create the partition, format the disk, mount it, move my home directory, and update fstab everything is great until I reboot. After a reboot I am unable to authenticate to the server using my SSH keys.

Although I can't authenticate over SSH, I am able to use the CustomLinuxScript extension in the Azure console to execute scripts that allow me to see that all disks are mounted properly, my public key is correct in /home/myUser/.ssh/authorized_keys, and that the permissions are set correctly on all of the files.

I'm very interested in whether anyone else has encountered this issue or if anyone knows what I'm doing wrong here.

  • 2
    This is really an interesting piece of issue. I ran into something similar in AWS. Can you please try ssh with -vvv option? should debug the proper reason for password less login. Also, as you have customlinuxscript in place, can you try executing "restorecon -r /etc/ssh"? SELinux sometimes causes these silly issues. – CloudGuy Mar 25 '15 at 13:28
  • Have you checked the ssh/auth/messages/syslog file for error messages? You could create user with home outside of /home to log in to and check and see what is going on. (btw. my guess is it's the permissions, you just missed something) – Fox Mar 25 '15 at 22:40
  • 1
    I found the issue. It was SELinux and caused by not restoring the context after the directory move. There also appears to be some items that SELinux doesn't like about the Azure agent but that is another issue and seems to be unrelated. – BryceH Mar 26 '15 at 13:44

This sounds like a selinux problem. Probably it is turned on and the security context of the new filesystem has not been set to the same value as the old one.

  • Yes. See the notes above. – BryceH Apr 3 '15 at 4:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.