title: Grant ubuntu access to www-data
body: <p>I'm running Ubuntu and would like to be able to upload files using SSH to update the website code.</p>
  
  <p><strong>my ubuntu user ( id ubuntu )</strong></p>
  
  <pre><code>root@****:/var/www# id ubuntu
  uid=1000(ubuntu) gid=1000(ubuntu)     groups=1000(ubuntu),4(adm),20(dialout),24(cdrom),25(floppy),27(sudo),29(audio),30(dip),33(www-data),44(video),46(plugdev),102(netdev)
  </code></pre>
  
  <p><strong>My ubuntu groups (groups ubuntu)</strong></p>
  
  <pre><code>root@****:/var/www# groups ubuntu
  ubuntu : ubuntu adm dialout cdrom floppy sudo audio dip www-data video plugdev netdev
  </code></pre>
  
  <p><strong>All the groups on my ubuntu server (more /etc/group)</strong></p>
  
  <pre><code>    root@****:/var/www# more /etc/group
      root:x:0:
      daemon:x:1:
      bin:x:2:
      sys:x:3:
      adm:x:4:syslog,ubuntu
      tty:x:5:
      disk:x:6:
      lp:x:7:
      mail:x:8:
      news:x:9:
      uucp:x:10:
      man:x:12:
      proxy:x:13:
      kmem:x:15:
      dialout:x:20:ubuntu
      fax:x:21:
      voice:x:22:
      cdrom:x:24:ubuntu
      floppy:x:25:ubuntu
      tape:x:26:
      sudo:x:27:ubuntu
      audio:x:29:ubuntu
      dip:x:30:ubuntu
      www-data:x:33:ubuntu
      backup:x:34:
      operator:x:37:
      list:x:38:
      irc:x:39:
      src:x:40:
      gnats:x:41:
      shadow:x:42:
      utmp:x:43:
      video:x:44:ubuntu
      sasl:x:45:
      plugdev:x:46:ubuntu
      staff:x:50:
      games:x:60:
      users:x:100:
      nogroup:x:65534:
      libuuid:x:101:
      netdev:x:102:ubuntu
      crontab:x:103:
      syslog:x:104:
      fuse:x:105:
      messagebus:x:106:
      mlocate:x:107:
      ssh:x:108:
      landscape:x:109:
      admin:x:110:
      ubuntu:x:1000:
      mysql:x:111:
      ssl-cert:x:112:
  </code></pre>
  
  <p>Why am i unable to overwrite files in the /www/var/html folder as Ubuntu user?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p><strong>My Folder permissions for /var/www and /var/www/html are:</strong></p>
  
  <pre><code>root@****:/var/www# ls -l
  total 4
  drwxrwxr-x 3 www-data www-data 4096 Oct 13 20:24 html
  root@****:/var/www# cd html
  root@****:/var/www/html# ls -l
  total 4
  drwxrwxr-x 9 www-data www-data 4096 Oct 13 20:24 somefolder
  </code></pre>
  
  <p><strong>MOUNTED DRIVES (mount)</strong></p>
  
  <pre><code>    root@****:/# mount
      /dev/xvda1 on / type ext4 (rw,discard)
      proc on /proc type proc (rw,noexec,nosuid,nodev)
      sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
      none on /sys/fs/cgroup type tmpfs (rw)
      none on /sys/fs/fuse/connections type fusectl (rw)
      none on /sys/kernel/debug type debugfs (rw)
      none on /sys/kernel/security type securityfs (rw)
      udev on /dev type devtmpfs (rw,mode=0755)
      devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
      tmpfs on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=0755)
      none on /run/lock type tmpfs (rw,noexec,nosuid,nodev,size=5242880)
      none on /run/shm type tmpfs (rw,nosuid,nodev)
      none on /run/user type tmpfs (rw,noexec,nosuid,nodev,size=104857600,mode=0755)
      none on /sys/fs/pstore type pstore (rw)
      /dev/xvdb on /mnt type ext3 (rw)
      systemd on /sys/fs/cgroup/systemd type cgroup (rw,noexec,nosuid,nodev,none,name=systemd)
  </code></pre>