Friday, August 16, 2013

Mounting a Windows share using smbfs with read-write access

To mount a Windows share using smbfs do the following:
#: mount -t cifs -o username=your_user_name,uid=1000 //machine_name/share_name /mnt/point
Or the old style:
#: mount -t smbfs -o username=your_user_name,uid=1000 //machine_name/share_name /mnt/point
Note here that uid=1000 is not a magic number but rather your linux userid. You can get this value from passwd file normally located in /etc/passwd. The user with uid=1000 should be able to manipulate files pointed to by //machine_name/share.
And when connecting to a share that is mananged by Active Directory, need to escape the backslash for it to work, e.g.:
#: mount -t smbfs -o username=domain-name\\username,uid=1000 //machine_name/share_name /mnt/point

Notes:
Need to install smbfs for this to work, like (Debian/Ubuntu):
#: sudo apt-get install cifs-utils

~ts~

No comments: