How to mount a Samba share in a Linux/UNIX environment

logo_samba.biu7haidj74s00w808s8kcoc4.17ldmg3f9ou8088wk04c40sgo.thThere are certain things I always forget.

This is one of the things that has kept me starring at a blank UNIX terminal, a few times to many. So I decided to finally document the solution I always end up searching for.

Mounting a Samba share on a Linux/UNIX system is pretty easy, but you might end up not having the right permission on the local folder where you are mounting the remote share, even though you successfully authenticate with the remote Samba username and password.

To make sure that the local permission on the mounted folder corresponds to your local user, you must remember to use the “uid”, “gid” and “fmask” options with the “-o” argument, as show below.

mount -t smbfs -o uid=local_user,gid=local_group,fmask=755 -o username=remote_samba_user,password=remote_samba_password //address.to.the.server/share /local/folder

Get printer-friendly version

Leave a reply