Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.


share|improve this question
This is pretty much a dup of this question. Might want to follow some answers there… – Jason Berg Aug 24 '10 at 2:28
up vote 1 down vote accepted

/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.

share|improve this answer
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
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 posting your answer, you agree to the privacy policy and terms of service.