I am setting up a user account to log into the server through SSH. The user name is 'sam'
sudo useradd sam
This created a /home/sam directory. I created a .ssh directory and wrote a public key to the authorized_keys file within this directory. I was able to log into the system using Putty and FileZilla (using the corresponding private key, of course)
However now I do this:
sudo usermod -d some_other_directory sam
Then I created .ssh within the above new home directory and created the authorized_keys file....all with appropriate permissions and ownerships (sam owner and sam group). I am not able to log into the system at all now....The second I change the home directory back to /home/sam I am again able to log in.....any ideas about what I am doing wrong here?