Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am mounting a Windows network drive to my Ubuntu machine and I am getting write permission errors when trying to edit a file.

sudo mount -t cifs

gives me

//MEDIASERVER/A on /home/anon/Media/Overflow/A type cifs (rw,noexec,nosuid,nodev)

and my fstab line is:

//MEDIASERVER/A /home/anon/Media/Overflow/A cifs username=USERNAME,password=PASSWORD,mode=0777,dir_mode=07‌​77 0 0
share|improve this question
    
If you get write permission errors when editing a file, it just looks like you don't have write permissions. I would check the server first, not the client. –  mgabriel Dec 28 '12 at 1:06
    
Checked...write permissions are fine. I can connect to them on other computers and write to them just fine –  rjbogz Dec 28 '12 at 1:10
    
Where is the write error? –  psusi Dec 28 '12 at 1:13
    
I am trying to edit a file in python, but I can't even open the file in gedit and write to it. Even if I run it as root. I'm not sure if my fstab line is correct or what, but after a whole lot of searching, I gave up. I have admin rights on both machines, I just can't seem to figure this one out. –  rjbogz Dec 28 '12 at 1:18
add comment

1 Answer

You mode and dir_mode are wrong. They are not permissions, but masks, (see man umask) or the man page for mount concerning mode: mode=value Set the mode of all files to value & 0777 disregarding the original permissions. Add search permission to directories that have read permission. The value is given in octal. Either set it to something reasonable like 022 or just use 0.

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.