Ubuntu 12.10 folder permissions (lost access to any folders after setting up sftp)

1

I have had an ubuntu 12.10 server running for a while with dlna and samba running successfully. On a previous build, I had an sftp server running and I wanted to do it again.

First, I updated all the installed packages (but didn't upgrade to 13.04). I then installed SSH and openSSH and setup sftp. I can successfully log in to the ftp account.

Aftewards I noticed however that my default user could no longer access the mount where my raid is. The dlna still operated however, from this mount point. The owner / group of this directory was set to nobody:nobody. I wondered if something had gone wrong and tried setting the owner to my default user name. Didn't work, so I tried creating a new group, adding the user (and the sftp user for good measure) to the group, and making the group the owner of the mount point.

I performed a reset and my default user can't access ANY directories now (permission denied). Doing ls-l in the root directory shows that everything belongs to root:root.

If I elevate my permissions to the root user (sudo -i), I can access everywhere successfully.

Can anyone make any suggestions for fixing this permissions issue? I'm not sure what I've broken but it is rather frustrating.

Nick

Posted 2013-10-10T22:25:09.257

Reputation: 11

when you say you tried to set the owner, what did you do, and it what way did it fail? are you able to access your home directory? – Frank Thomas – 2013-10-10T22:34:16.107

I tried to chown the directory with a command like sudo chown nick:media /raid/media.

At this time, my primary user cannot access any directory, including the home folder (permission denied). – Nick – 2013-10-10T23:01:54.860

Just noticed that I am also unable to log in to the server through putty. Does this suggest an SSH problem? – Nick – 2013-10-10T23:02:33.067

it may be an app problem, but that in itself doesn't suggest many fixes. try chowning your whole home to nick:nick (with -R), and check ls -al \home again to see if it sticks. if so, see if ssh works again. most distros use 740 for homes if you need to chmod. as for your raid, after running your chown command, what is the owner now? – Frank Thomas – 2013-10-10T23:08:11.590

My guess would be that your /etc/passwd or /etc/groups got corrupted. – ernie – 2013-10-10T23:52:46.773

@FrankThomas Thanks for the reply. I was on holiday so couldn't reply before.

Additional info:

  1. /home/nick is now owned by nick:root (chmod 740). I can enter that home directly and open files directly on the machine.
  2. I am still unable to log into the machine through putty. I get 'Network Error: Software caused connection abort'.
  3. In /etc/ssh/sshd_config, AllowGroups is sftpuser and root. AllowUsers is nick and sftpuser.
  4. nick is a member of the following various groups, including: nick, adm, sudo, sambashare, ssh, ftp, sftpuser, raid
  5. The passwd and groups files look ok.
  6. < – Nick – 2013-10-26T16:04:38.043

Answers

0

I fixed the problem by resetting the sshd_config file to default.

I followed the instructions from here:

https://askubuntu.com/questions/218957/12-04-sshd-config-file-is-empty-but-my-ssh-config-is-not-empty

Nick

Posted 2013-10-10T22:25:09.257

Reputation: 11