0

I have an external HDD mounted in my server. It's on /dev/sdb1 (or /media/usb0). I have a proftpd user which home directory is set to /media/usb0.

The problem is that the ownership of /media/usb0 is root, and I cannot change that. I always get permission denied when trying to upload a file.

I already tried setting chmod -R 777 /media/usb0/ but it does not work too.

The proftpd linux user is proftpd.

How do I set the right permissions to the usb hdd?

Thanks

rafaame
  • 109
  • 2

1 Answers1

1

I would guess that your USB device is using FAT as the filesystem? FAT does not support *nix style permissions. There is no concept of ownership or permissions, and so you are not permitted to use chmod/chmod on the folder.

When you mount a FAT filesystem under Linux you can pass a few options to set the UID/GID/Dmask, and Fmask.

See man mount

uid=value and gid=value
  Set the owner and group of all files. (Default: the uid and 
  gid of the current process.)
dmask=value
  Set the umask applied to directories only. The default is the 
  umask of the current process. The value is given in octal.
fmask=value
  Set the umask applied to regular files only. The default is 
  the umask of the current process. The value is given in octal.
Zoredache
  • 128,755
  • 40
  • 271
  • 413
  • My fstab: /dev/sdb1 /home/usbstorage0 auto noauto,uid=proftpd,fmask=022,dmask=022 0 0 and I still getting permission denied... Any idea? – rafaame Jul 07 '11 at 22:20
  • If login as that user via SSH or on the local system, is that user able to write to the fielsystem? – Zoredache Jul 07 '11 at 22:24