Celeb Glow
general | April 04, 2026

How to mount smb share on Ubuntu 18.04 with read-write from the terminal

Very new to Linux. I try to mount the folder from my work server. Installed CIFS Utils pkg. Created the folder inside /home/documents Then I use

Sudo mount -t cifs -0 user=user, //ServerIP/share /home/user/documents/share

The mount is done, I can see the folders and files, but only as read only. If I check permissions for my /home/documents/share folder I see that the owner is root and only root has read-write access. The problem is I work with this share with some Cad program using wine and it doesn't have the root access. What am I doing wrong? Thanks.

3

1 Answer

ajgringo619 corrected your sytax. The only thing remaining is to take possession of the mounted share with a uid=user:

sudo mount -t cifs -o rw,user=user,uid=user //ServerIP/share /home/user/documents/share

The user in user=user is the user name you pass to the server as credentials. The user in uid=user is the user name on the client that is mounting the share.

CIFS is a virtual filesystem. When you mount a share on the client it creates a "view" of the remote share on the client and by default sets the owner to root since he is the one mounting it. uid=user replaces root as the owner of the mounted share with "user".

EDIT: BTW, how do I enable access to everyone?

sudo mount -t cifs -o rw,user=user,uid=user,nounix,dir_mode=0777,file_mode=0777 //ServerIP/share /home/user/documents/share
5

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy