android bsd linux unix & open-source world


FreeBSD: How to mount SMB/CIFS shares under FreeBSD

This document provides help on mounting SMB/CIFS shares under FreeBSD Operating System.
The mount_smbfs command mounts a share from a remote server using SMB/CIFS protocol. You can easily mount MySharedFolder share using the following syntax:

mount_smbfs -I //myUser@serverName/mySharedFolder /mnt/mySharedFolder

Where, is the IP address of the remote computer.
myUser is your user name.
serverName is NETBIOS Server Name.
mySharedFolder is CIFS share name.
/mnt/mySharedFolder is the local mount point directory.

Print This Post Print This Post

How To Access SAMBA shares through SSH in Linux

You can access Samba shares by using SSH tunneling. We need a host computer (x.y.z.w) and a destination computer (, is located in the x.y.z.w network), we'll use adi as username and pass as password.

First we'll create a new mount directory:

# mkdir -p /mnt/share

Now we connect to it:

# ssh -N -L 139: adi@x.y.z.w

Now we have to run the following commands:

# umount /mnt/share

# mount -t smbfs -o username=adi,workgroup=WORKGROUP,password=pass,port=139,dmask=770,fmask=660,netbiosname=computer1 //localhost/share /mnt/share

x.y.z.w=computer's IP address computer
adi=samba username
WORKGROUP=your workgroup
pass=password for the share

Print This Post Print This Post