Samba shares can be accessed in several ways, such as issuing the mount command, using /etc/fstab entries, accessing it through file browsers such as Konqueror, Midnight Commander and Nautilus.
The current post addresses /etc/fstab entries on Linux systems.
To automatically mount a Samba share at boot time we need to edit the /etc/fstab file and add the necessary entry:
- $ su
- # vim /etc/fstab
//192.168.0.1/share /mnt/samba smbfs username=username,password=yourpassword 0 0Due to security issues it’s not a good idea to put username/password in the /etc/fstab file. So you can change the username=username,password=password section and replace it with credentials=/root/.fstabcredentials:
- # vim /etc/fstab
//192.168.0.1/share /mnt/samba smbfs credentials=/root/.fstabcredentials 0 0Next we create the /root/.fstabcredentials file and add the needed information:
- # vim /root/.fstabcredentials
username=usernameSubstitute the username and password arguments according to your system.
password=password
To further close access to the file we change it's permissions:
- # chmod 600 /root/.fstabcredentials
Resources:
http://us3.samba.org/samba/
No comments:
Post a Comment