I have a server which has a low storage problem.
What i want is to mount the userec2-user
‘s home directory that is/home/ec2-user
to another attached storage drive which is available at/dev/xvdk
and its partitioned asxfs
and the partition is/dev/xvdk1
.
So what i did is login asbob
and rename/home/ec2-user
to/etc/ec-user-backup/
and thenrsync
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 withmount -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 is600
. 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