Monday, August 10, 2009

Mounting Remote Windows Shares in Ubuntu

I have a Netgear NSLU2 hooked up on my network to an external hard drive that I back up all my photos and music to. Naturally, now that my new netbook is here, I wanted a way to access all of my photos and music from Ubuntu. Here's the steps required to set up Windows file sharing with now that my new netbook is here Ubuntu.
1) First, you need to install smbfs:
$ sudo apt-get install smbfs

2) Create a directory to mount to:
$ sudo mkdir /mnt/netdrive

3) Mount the remote filesystem:
sudo mount -t cifs //{remote_ip_address}/{windows_share_drive} /mnt/netdrive -o username=YourUsername,password=YourPassword

4) Now, if you want this filesytem to mount each time you start Ubuntu add this entry to your /etc/fstab:
//{remote_ip_address}/{windows_share_drive}  /mnt/netdrive  cifs exec,credentials=/etc/passwdcifs 0 0

5) Create a file named /etc/passwdcifs and add these entries:
username=YourUsernamepassword=YourPassword

6) Secure the permissions on the password file:
$ sudo chmod 600 /etc/passwdcifs

Now when you reboot your filesystem should automatically be mounted. It's as easy as that!
share on: facebook

0 comments: