5

How to mount a samba share permanently in Ubuntu 10.10? Also, I don't want to display the share icon on my desktop. How to achieve this task?

Bilesh Ganguly
  • 514
  • 7
  • 18
karthick87
  • 80,647
  • 59
  • 193
  • 232

4 Answers4

4

If you ask about permanent mount, you should use configuraion via fstab.

Edit file //etc/fstab with root priviledges (for example sudo leafpad //etc/fstab)

and add a line which could look like this:

//<IPaddress>/<ShareName>   /<mountPoint>   cifs    user=<userName>,pass=<passwd> 0 0

You should use network drive username and password. Disadvantage is password written in a file. MountPoint should exist, (for example /mnt/NetworkDrive), create the folder before you reboot.

Save fstab and reboot. Done.

To ommit disadvantages, create .smbcredentials file

sudo leafpad /home/.smbcredentials

with following structure:

username=msusername
password=mspassword

and set

sudo chmod 600 /home/.smbcredentials

fstab line should be then as follows:

//<IPaddress>/<ShareName>   /<mountPoint>   cifs    rw,credentials=/home/.smbcredentials,iocharset=utf8,nounix, file_mode=0777,dir_mode=0777 0 0
Dee
  • 1,976
  • 4
  • 19
  • 36
3

Here is a very detailed set of instructions on how to do this permanently from an Ubuntu point of view.

https://help.ubuntu.com/community/MountWindowsSharesPermanently

Eric Johnson
  • 6,055
  • 6
  • 24
  • 22
2

You should add it to /etc/fstab. I don't have a SMB server available at the moment but I think the fstab entry should look something like:

//server/share /mountpoint smbfs

man fstab and man mount are your friends here.

Dennis Hostetler
  • 502
  • 1
  • 4
  • 9
0

better choice than

mount -t smbfs //servername/sharename /mountdirectory -o username=mywindowsusername,password=mywindowspassword

sould be

sudo mount -t smbfs //servername/sharename /mountdirectory -o credentials=/root/.credMywindowsAccount

and in /root/.credMyWindowsAccount

username=mywindowsusername
password=mywindowspassword
Evandro Silva
  • 9,472
  • 6
  • 35
  • 44
patrick L
  • 9
  • 1