2 Replies - 551 Views - Last Post: 01 April 2018 - 01:38 PM

#1 Splashsky   User is offline

  • D.I.C Regular
  • member icon

Reputation: 12
  • View blog
  • Posts: 334
  • Joined: 25-August 13

RaspPi SFTP Permissions

Posted 01 April 2018 - 10:57 AM

I recently bought the Raspberry Pi 3 and have really enjoyed using it as a local web server to play around with, and recently I opted to use it as my open-facing web host instead of paying a hosting service to do it. I have consistent 1Gbps up/down where I live so it's no big deal bandwidth-wise and I'm not expecting lots of traffic.

That being the case, I've set up nginx, PHP7 and MariaDB on the Pi and opened it up to the internet. I've got CloudFlare working as a layer over the top of it for SSL and a lil extra security. I've installed UFW and allowed SSH, port 20 80 (fixed that lol) and SFTP. I can connect to the Pi via SFTP, but when I try to upload or modify files in my /var/www/html directory, my FTP client (Transmit on Mac) says I don't have permissions; usually an error like "couldn't get remote handle".

I've added my user "splashsky" to the list of sudoers and executed sudo chmod -R u+rwx /var/www/html/ to no avail. What do I do here?

This post has been edited by Splashsky: 01 April 2018 - 11:02 AM


Is This A Good Question/Topic? 0
  • +

Replies To: RaspPi SFTP Permissions

#2 Splashsky   User is offline

  • D.I.C Regular
  • member icon

Reputation: 12
  • View blog
  • Posts: 334
  • Joined: 25-August 13

Re: RaspPi SFTP Permissions

Posted 01 April 2018 - 11:43 AM

As a temporary (maybe unsafe?) solution, I added the "splashsky" user to the www-data group and gave that group w (recursively) and s permissions to the directory. If that's unsafe, please let me know the best and safest way to do this :D
Was This Post Helpful? 0
  • +
  • -

#3 no2pencil   User is offline

  • Professor Snuggly Pants
  • member icon

Reputation: 6794
  • View blog
  • Posts: 31,349
  • Joined: 10-May 07

Re: RaspPi SFTP Permissions

Posted 01 April 2018 - 01:38 PM

Adding a user to www-data is safer than just granting everything 777. In fact, it's how I handle users allowing them access to www owned files/directories.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1