Richard Grant Posted October 3, 2014 Share Posted October 3, 2014 I am mounting my usb with: sudo mount "/dev/sdb1" "/opt/lampp/htdocs/" This will mount my usb to the folder htdocs but obviously i am having permission issues because when i go to my localhost (web browser) it says: _________________________________________________________ Access forbidden! You don't have permission to access the requested directory. There is either no index document or the directory is read-protected. If you think this is a server error, please contact the webmaster. Error 403 __________________________________________________________ How can i fix this issue? Link to comment Share on other sites More sharing options...
Richard Grant Posted October 3, 2014 Author Share Posted October 3, 2014 I THINK the issue is this: ls -ld htdocs Returns: drwx------ 9 richard richard 4096 Dec 31 1969 htdocs When ORGINALLY it returns: (this is what i need the permissions to be with read and write access) drwxr-xr-x 5 root root 4096 Oct 2 21:04 htdocs Link to comment Share on other sites More sharing options...
Haggis Veteran Posted October 3, 2014 Veteran Share Posted October 3, 2014 try sudo mount /dev/sdb1 /opt/lampp/htdocs/ -o umask=000 Link to comment Share on other sites More sharing options...
Richard Grant Posted October 3, 2014 Author Share Posted October 3, 2014 try sudo mount /dev/sdb1 /opt/lampp/htdocs/ -o umask=000 didn't work output: drwx------ 9 richard richard 4096 Dec 31 1969 htdocs i need it to output: drwxrwxrwx 5 root root 4096 Oct 2 21:04 htdocs Link to comment Share on other sites More sharing options...
Haggis Veteran Posted October 3, 2014 Veteran Share Posted October 3, 2014 For NTFS file system: You should edit the fstab file. Type the following in terminal: sudo gedit /etc/fstabAt the bottom of the fstab file paste the following: /dev/sdb1 /opt/lampp/htdocs ntfs-3g defaults 0 0For FAT 16/32 file system run the following in terminal: sudo mount -t vfat /dev/sdb1 /opt/lampp/htdocs -o uid=1000,gid=100,utf8,dmask=027,fmask=137 Link to comment Share on other sites More sharing options...
Richard Grant Posted October 3, 2014 Author Share Posted October 3, 2014 ok is it fat32 or ntfs? fat32 -t vfat Link to comment Share on other sites More sharing options...
Haggis Veteran Posted October 3, 2014 Veteran Share Posted October 3, 2014 see post above :) Link to comment Share on other sites More sharing options...
Richard Grant Posted October 3, 2014 Author Share Posted October 3, 2014 see post above :) still did not work: sudo mount -t vfat /dev/sdb1 /opt/lampp/htdocs -o uid=1000,gid=100,utf8,dmask=027,fmask=137 drwx------ 9 richard richard 4096 Dec 31 1969 htdocs i also tried: sudo mount -t vfat /dev/sdb1 /opt/lampp/htdocs -o uid=0,gid=0,utf8,dmask=027,fmask=137 because: sudo id ouput: uid=0(root) gid=0(root) groups=0(root) i also tried: chmod -R 777 /opt/lampp/htdocs ouput: chmod: changing permissions of '*': Operation not permitted Link to comment Share on other sites More sharing options...
Haggis Veteran Posted October 3, 2014 Veteran Share Posted October 3, 2014 is your user a member of www-data Link to comment Share on other sites More sharing options...
Richard Grant Posted October 3, 2014 Author Share Posted October 3, 2014 is your user a member of www-data No how do i set it (i assume it is not because i did not manually set it, so checking if i am first would be nice) I set: usermod -a -G www-data richard Link to comment Share on other sites More sharing options...
Haggis Veteran Posted October 3, 2014 Veteran Share Posted October 3, 2014 No how do i set it (i assume it is not because i did not manually set it, so checking if i am first would be nice) I set: usermod -a -G www-data richard I would use sudo useradd -g www-data richard Link to comment Share on other sites More sharing options...
Richard Grant Posted October 3, 2014 Author Share Posted October 3, 2014 I would use sudo useradd -g www-data richard I dont want to make a new account, i already have an account called richard Link to comment Share on other sites More sharing options...
Max Norris Posted October 3, 2014 Share Posted October 3, 2014 I dont want to make a new account, i already have an account called richard That doesn't make a new account, it's adding you to the group www-data, although isn't -g setting the primary group? Link to comment Share on other sites More sharing options...
Richard Grant Posted October 3, 2014 Author Share Posted October 3, 2014 That doesn't make a new account, it's adding you to the group www-data, although isn't -g setting the primary group? When i use useradd i get the output: useradd: user 'richard' already exists so user add does create a new user And when i modify the group i get: drwx------ 2 richard www-data 4096 Oct 3 11:13 htdocs Which is not what i want. I want to mount the USB with the root user and root group so it should read: drwx------ 2 root root 4096 Oct 3 11:13 htdocs Link to comment Share on other sites More sharing options...
Richard Grant Posted October 3, 2014 Author Share Posted October 3, 2014 YES!! after 3 hours i SOLVED IT! Okay its pretty simple. I reformatted with the option: compatible with linux systems (Ext4) to fix the usermod that Haggis suggested: sudo usermod -a -G root richard ejected my usb (correctly) unplugged and replugged back in A unity file system window came up with a fold of the name of my usb partition mine was Vault I right clicked Properties > Permissions changed all the accessors to: Create and Delete files Ultimately this is what i was trying to do from command line but i couldn't figure out how. Link to comment Share on other sites More sharing options...
Recommended Posts