2

I use sftp to backup my laptop (Ubuntu 18.10) onto a server (Ubuntu 18.04) on my local network. Suddenly something has gone wrong with the permissions on the server and I started getting access denied warnings. My username on the server also lost membership of the sudoers group. I added the user back into the sudoers group but cannot get the access to the backup folder without running sudo chmod -R 777. Obviously, for security reasons, I need to have at least 775 permissions on this file but I don't know what user to add to what group to achieve this.

EDIT I tried adding the backup folder owner to the ssh group but that didn't work.

Information requested:

~$ ls -l /home/biergarten 
   total 1172 
   drwxrwxr-x 2 biergarten ssh 1167360 Feb 6 00:27 BackupLaptopSSD
   drwxrwxr-x 2 biergarten ssh 20480 Apr 23 09:20 BackupTuxedo
   -rwxrwxr-x 1 biergarten ssh 58 Oct 20 2016 delPhotos.sh
   -rwxrwxr-x 1 biergarten ssh 131 Dec 14 2016 FTP_TEST123.txt


~$ groups biergarten ssh
  • post the outputs of ls -l /path/to/your/backups and groups - as the user on the server – rm-vanda Apr 23 at 21:00
  • ~$ ls -l /home/biergarten total 1172 drwxrwxr-x 2 biergarten ssh 1167360 Feb 6 00:27 BackupLaptopSSD drwxrwxr-x 2 biergarten ssh 20480 Apr 23 09:20 BackupTuxedo -rwxrwxr-x 1 biergarten ssh 58 Oct 20 2016 delPhotos.sh -rwxrwxr-x 1 biergarten ssh 131 Dec 14 2016 FTP_TEST123.txt – SteveInBavaria Apr 23 at 21:05
  • ~$ groups biergarten ssh – SteveInBavaria Apr 23 at 21:07
  • I've added the details you provided to your question. Please check if I've done so correctly. – Justice for Monica Apr 24 at 1:53
  • Correct, thanks. I should have done that but, in my defence, it was getting late and I'd been working on this problem for a few hours. :-( – SteveInBavaria Apr 24 at 5:59
0

You probably just need to chown the directory back to your user & the appropriate group.

sudo chown -R your-user:appropriate-group /path/to/backups

Then you need to investigate how your user got dropped from the sudo group!

  • Thanks, I tried that but still cannot backup with Deja-Dup and 'sftp://192.168.1.9/home/backup/' And a funny thing happened, after adding the user to the ssh group and re-booting, the user was removed from the sudoers group. I am 100% sure the user was in sudoers before the chown command because I ran it fron the users account. – SteveInBavaria Apr 23 at 20:51
  • I had something similar happen once upon a time... perhaps worth double checking your syntax: usermod -G groupname -a username – rm-vanda Apr 23 at 20:58

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.