Windows Network Share
- First of all, you need to have [Setting_up_Samba] installed and configured on the Linux machine.
- Not to forget, there should also be a working tcp/ip network connection between the linux and the windows computer. For my example,
- the windows machine's name is limette, the share is named 2Share
- the linux' one is called orange
- both should be part of the workgroup zitrusgarden.
- Find or create the mount point, where the share could be mounted to.
# mkdir -p /mnt/shares/limette
- Mount the share using the
smbmount //server/sharename mountpoint -o workgroupworkgroup usernameusername ip=serverip
server is the name of the Windows computer.
sharename is the name of the share.
mountpoint is the directory that you are mounting the share to.
-o Options to smbmount.
workgroup= used to specify the workgroup. As default the workgroup is "WORKGROUP".
username= used if you need to specify a username to mount the share as, commonly used for Windows NT shares.
ip= used if the Linux computer can't find the Windows computer by name (dns, wins, hosts entry), serverip is the IP address of the server.
NOTE: in latest samba, you can also use cifsmount which is preferred cause some win2k and win2k3 won't work with smbmount
# smbmount //limette/Folder2Share /mnt/shares/limette -o workgroup zitrusgarden username pink_chick ip=192.168.23.132
NOTE: //limette/Folder2Share/ WILL NOT WORK! (so don't type the trailing / )
smbumountto quit the share: smbumount mountpoint.
- Adding the share to /etc/fstab for easy mounting
//limette/2Share /mnt/shares/limette smbfs noauto,user,noatime,username
guest,password,workgroup=YOURWORKGROUP 0 0
- Allowing users to mount Samba shares
For users to be allowed to mount and unount the Samba share, the following two files have to be set UID like this:
chmod u+s /usr/bin/smbmnt chmod u+s /usr/bin/smbumount
If you still get a "permission denied" problem, you might have to change the owner of the mount point to the user that wants to mount the share. I don't know, whether it is the best solution for this problem, but it works for me.
chown YOURUSER:YOURGROUP /mnt/shares/limette
Now you should be able to mount and unmount your Samba shares with
# mount /mnt/shares/limette # smbumount /mnt/shares/limette
RC Script for LISA (KDE LAN Browsing Daemon)
If you want to easily browse Samba and other shares on your local network (with KDE), LISA is what you need. It comes with the kdenetwork package. To start it on every boot add
lisa to the DAEMONS array in /etc/rc.conf.