Not able to ssh into server after mounting users home on other ebs volume [closed]

I have a server which has a low storage problem.
What i want is to mount the user ec2-user‘s home directory that is /home/ec2-user to another attached storage drive which is available at /dev/xvdk and its partitioned as xfs and the partition is /dev/xvdk1.
So what i did is login as bob and rename /home/ec2-user to /etc/ec-user-backup/ and then rsync all files to the extra attached storage in /dev/xvdk1. Then mount that drive at /drive2. So now the c2-user’s home directory is present at /drive2/ec2-user/. Now I create a symlink in /home/ec2-user which points to /drive2/ec2-user.

I also update the /etc/fstab accordingly. Check with mount -a. ec2-user‘s home directory has moved to new storage and is working.

The problem arises when i try to ssh in as ec2-user. The ssh key that was working previously has stopped working now. I have looked at the permissions on user’s .ssh and all files under this and they seem to be alright. which is 600. Also im able to login in with password but not the ssh key.

What am i missing?

Answer

The .ssh directory needs to have u+x permission set too

chmod u+x /home/ec2user/.ssh 

Attribution
Source : Link , Question Author : Saad Masood , Answer Author : user9517

Leave a Comment