Tuesday, 20 October 2009

Mounting a Windows network drive to Linux

Easy enough after I figured the first part, that Ubuntu did not come with the necessary package by default. So this is how I did it:
  • sudo aptitude install smbfs
  • sudo mkdir /mnt/mntpoint
  • sudo mount -t smbfs //server/directory /mnt/mntpoint -o credentials=/home/my/.smbpasswd
The .smbpasswd file looks like

username=<AD username>
password=<AD password>

I did a chmod 600 on that file so no-one else can see my AD password.

To automount this on boot, I added the following line to /etc/fstab:
//server/directory /mnt/mntpoint smbfs
credentials=/home/my/.smbpasswd,uid=1000,gid=1000 0 0


Where uid and gid are my uid and gid on the box.

No comments:

Post a comment