How to make mounted external drive writable over SFTP

0

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?

roflwaffle

Posted 2010-05-24T20:36:06.367

Reputation: 1 640

Answers

1

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.

Stacey Richards

Posted 2010-05-24T20:36:06.367

Reputation: 1 292