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?
4 Answers
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
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
-
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.
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
-
2