2

I recently made changes to /usr/sbin and /var: chown root:root and then did chmod 775 for each. I basically wanted to only have the root user, and those users that belong to certain groups access those folders (all other users can't access). When I made these changes, now I can't use ssh to get to the server remotely. Any ideas on how/what files and directories are affecting this?

1 Answer 1

5

Playing with the file-system's permissions is a dangerous game if you don't know what you are doing.

That said, by chaning the permissions to 775 from their default 755, you've actually made them more accessable: from rwxr-xr-x to rwxrwxr-x .. or in human terms, you'd allowed the options for users in the group which owns the file to write to it, where as before, only the owner of the file could write to it.

It's more likely that changing the ownership of some files to root:root has done the damage, as some processes need to be started as designated users, reserved by the system.

In the future, I suggest you look at logging your users into a chroot jail, instead of recursively - and blindly - blanket modding your entire file-system.

You have a couple of options now:

  1. sudo apt-get remove --purge the packages which are not working (openssh-server in this case), and then reinstall them.
  2. install the services which aren't working on your server onto you ubuntu desktop and have a look around at the ownership of the files it installs using ls -l. Change them on the server to match (Ouch)
  3. Reinstall the system. (Doh.)

There may be a very fancy way of sorting this out, but I don't know it. Hopefully that's given you some clues/insight anyhow.

Good luck!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .