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.



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

This should be fixable by:

$ chown root /var/run/sshd
$ chmod 744 /var/run/sshd

I'd guess that you're going to run into a plethora of other permissions errors after correcting this one, but that should at least get you started.


Since you're on linode, you have several other options to restore your data, all of which will probably be easier than trying to massage your sshd into working order. I'm a long-time linode customer and have had to do this a couple of times...

First option, and possibly easiest, temporarily upgrade to a larger plan or purchase additional disk space. Then you can deploy a new, clean linux install into the extra space and then mount your broken volume from within the good install. Get all of your data transferred into the new install, delete the old image, and downsize back to whatever size server you had previously.

Second option, you can use the included Finnix rescue distribution to mount your system and then transfer the entire disk image to your local workstation, where you'll be able to get the data off.

  • Thank yo very much. I had already corrected the permission for mysql and now the website is working fine. SSH is also responding well. Thanks again. – Matt Aug 24 '10 at 2:37
  • 2
    I'm glad to hear that it's working. You're surely going to want to re-install though, as you'll never really be able to predict what issues the bad permissions might have in the future. The steps I outlined above should help you in your reinstall process. – EEAA Aug 24 '10 at 2:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy