Im gonna need some help restoring my ssh settings as i screwed everything up by calling this command:

chown -R user /

At the moment im not able to access the site through ssh/ftp since the ownership of all the files have been changed. I dont want to reset every ownership but if i could get ssh working i would be able to create a backup of my files and then get a clean install of ubuntu on my server.

Here is the error that i get when im trying to restart ssh:

/var/run/sshd must be owned by root and not group or world-writable.

Im running ubuntu 10.04 LTS. Any help is very much appreciated.

P.S. I am able to run ssh commands on a browser based AJAX console that my hosting company (linode) provides.

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

This is why you never login as root! If you were your own user, you wouldn't have been able to do this!
–
jathanismAug 24 '10 at 18:56

Well... maybe, but chown always has to be run as root (at least on my system. I don't know if this is configurable). So even if you're not logged in as root, you'd still be using sudo or something whenever you run a chown command.
–
David ZAug 25 '10 at 1:09

it is probably safer to restore from the backup. While this probably get close to fixing it, I am not sure if anybody has ever checked it. And furthermore, it only fixes the root group, not any other users.
–
txwikingerAug 24 '10 at 19:51

From what I gather, there is no backup to restore from. He wants to make a backup once SSH'd in. For other files he could make a quick local install with a similar config do a funny find that prints the full path and owner, port that list to the broken server and then restore owners from that file. None of this is as "good" as a clean install or a real backup but time is often a factor.
–
Oli♦Aug 24 '10 at 20:26