I have an Ubuntu 12.04 mediaserver at home. All the files are kept under a username of data at /home/data. My HTPC mounts the server via sshfs and connects using rsa keys. All was working fine until yesterday when I stupidly changed the file permissions of the user called data on the server. I changed the permissions to a+wrx /home/data (I can hear you all laughing) and now everytime I try to connect I am prompted for a the data@xbmc password.

I've googled around and tried changing permissions as suggested in a few posts, but nothing seems to put things back.

Here is the output for the server's permissions. Can anyone spot what I need to change?

Thanks Nelz. Comparing the two .ssh folders. (one on the server and the other on my main pc, it seems that the main pc has a flie called id_rsa which is missing from the server. Is it correct to assume this is the private key file?

However, This doesn't seem to be the root of my problem. It seems that the issue was that the home directory for data on the server was too open. Changing the permissions

If I've understood right your HTPC connects to the Ubuntu server via ssh, so the Ubuntu server has the public key - id_rsa.pub and the HTPC will have the private key - id_rsa , the private key will not be on the Ubuntu box.

The HTPC's public key shouldn't be on the server at all, except as part of the authorized_keys file. If this is the HTPC's public key, you should delete it. If it's the server's public key, you have a file missing.

"Insanity: doing the same thing over and over again and expecting different results." (Albert Einstein)

nelz wrote:The HTPC's public key shouldn't be on the server at all, except as part of the authorized_keys file. If this is the HTPC's public key, you should delete it. If it's the server's public key, you have a file missing.

It was the HTPC's public key. I thought you had to copy the public key over to the remote server. I followed Mayank's tutorial in issue 155 OpenSSH Easy logins.
At the end of the tutorial Mayank says "The next step is to copy the public key to the remote server... You can move the key with a single command"

Yes you do, and that command will do it. But you copied the file as-is, which can't work, what happens if you want to log in from more than one computer? The contents of the public key file have to be copied into the authorized_keys file on the server, which is what ssh-copy-id does.

You can, and should, delete the public key file from the server.

"Insanity: doing the same thing over and over again and expecting different results." (Albert Einstein)

I thought it was odd only having one .pub file when I have 3 PC that connect to the server. I thought that maybe ssh rolls them all into one. God only knows how and when I copied it over as I've always used the ssh-copy-id command.