Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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