I have a user that I log in with over SFTP to my Ubuntu box. They have permission to write to the home directory of course. The external hard drive gets mounted to /media folder but I can't write to it over SFTP while logged in with that user. How would I set the permissions to allow me to write to the drive?

link|improve this question

77% accept rate
feedback

1 Answer

up vote 1 down vote accepted

Unmount the drive from it's default mount point in /media.

Manually create a folder and give it suitable permissions (let's say 700).

Manually mount the drive to that folder.

Example, if the drive is formated ext4 and is installed on your system as /dev/sdb1:

mkdir ~/rwdrive
chmod 700 ~/rwdrive
mount -t ext4 /dev/sdb1 ~/rwdrive

Obviously you would specify the actual file system type by substituting it with ext4, and the actual device by substituting it with /dev/sdb1

You should now be able to write to the drive.

If you always have the drive plugged in, you might like to add the mount to /etc/fstab.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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