Mount Windows Share with R/W Permissions

maj

maj

Soldato
Joined
19 Jul 2010
Posts
2,598
Location
Durham
I've recently started using Linux and have a headless Ubuntu server which I would like to access a network drive on my server with write permissions. I can mount the network drive with the following command in my fstab file:

Code:
//IP Address/share /media/mountname cifs credentials=/home/username/.smbcredentials,iocharset=utf8,sec=ntlm 0 0


I've also tried:

Code:
//IP Address/share /media/mountname cifs credentials=/home/username/.smbcredentials,uid=1000,gid=1000  0  0


Where uid and gid matches my ubuntu username details using 'id username' command.

My .smbcredentials file contains the Windows username and password on my Windows server which has r/w permissions to the shared drive:

Code:
username=wUsername
password=wPassword


If I putty onto the Linux server I can view the Windows share at the mount point but if I try to create a test.txt file on the mount point using 'touch' command I get denied permission.

How do I map a Windows share with r/w permissions?
 
Soldato
Joined
10 Oct 2005
Posts
8,706
Location
Nottingham
Try using the following options as appropriate (note wrapped) :

Code:
//nas07/Pictures        /mnt/pictures cifs rw,_netdev,iocharset=utf8,credentials
=/root/.creds,dir_mode=0755,uid=1000,gid=1000,vers=3.0 0 0

(This is from the fstab file on one of my Linux boxes which is mounting a Windows/Samba share off of one of the NASes)
 

maj

maj

Soldato
OP
Joined
19 Jul 2010
Posts
2,598
Location
Durham
Try using the following options as appropriate (note wrapped) :

Code:
//nas07/Pictures        /mnt/pictures cifs rw,_netdev,iocharset=utf8,credentials
=/root/.creds,dir_mode=0755,uid=1000,gid=1000,vers=3.0 0 0

(This is from the fstab file on one of my Linux boxes which is mounting a Windows/Samba share off of one of the NASes)

Thanks. Meant to reply earlier but only just managed to get this working how I want.

That seemed to work in the extent that if I logged in via putty as my local user I could create files/folders at the mount point and also move files to it which is what I wanted. This particular server has a system account which I also required to have R/W permissions to the mount point which it didn't seem to have. Was messing on with chmod etc to no avail.

To fix it I amended the fstab line so the uid is the system account and it seems to work how I want it. Not sure how I didn't think to do that earlier but main thing is it is now working.
 
Back
Top Bottom