Install smbfs:
sudo apt-get install smbfs
OR alternatively you can use cifs-utils:
sudo apt-get install cifs-utils
Either will work, they are two different programs that implement windows shares. I've used smbfs successfully with the following steps, haven't tested it on cifs.
If you only want a temporary mount, for smbfs the command would be (all one line):
mount -t smbfs //server/share /mountdirectory -o username=share_user_name,password=share_password
Replace smbfs with cifs in this command if you've elected to use cifs-utils.
If you want these shares to mount automatically on boot:
Create a credentials file somewhere secure, name it .smbcredentials
, and give it these contents:
username=share_username
password=share_password
To secure this file:
sudo chown root .smbcredentials
sudo chmod 600 .smbcredentials
Add this line to /etc/fstab
(all on one line):
//server/share /mountdirectory smbfs credentials=/path/to/.smbcredentials,uid=USERSID,gid=USERSGROUPID 0 0
OR if using CIFS (again, all on one line):
//server/share /mnt/mountdirectory cifs iocharset=utf8,credentials=/home/whoever/.smbcredentials,dir_mode=0775,uid=USERID,gid=USERGROUPID 0 0
Here USERID is the id of the user that you want to have ownership of the mounted folder, and USERGROUPID is that users group id. Those can be found in /etc/passwd and /etc/group.
If you added one of those lines to your /etc/fstab file, you can now mount the share:
sudo mount -a
You should now see those shares mounted under the ownership of the local user and group you indicated in USERID and USERGROUP.