smb shares. You cannot mount a share on your host, but you can use it in a
way that is similar to an FTP client. Several options can be used with the
smbclient command. The most frequently used is -I followed by the IP
address of the computer to which you are connecting. The smbclient
command does not require root access to run:
Click here to view code image
matthew@seymour:~$ smbclient -I 10.10.10.20 -Uusername%password
This gives you the following prompt:
Click here to view code image
smb:
From here, the commands are almost identical to the standard UNIX/Linux
FTP commands. Note that you can omit a password on the smbclient
command line. You are then prompted to enter the Samba share password.
Mounting Samba Shares
There are two ways to mount Samba shares to your Linux host. Mounting a
share is the same as mounting an available media partition or remote NFS
directory except that the Samba share is accessed using SMB. The first
method is to use the standard Linux mount command:
Click here to view code image
matthew@seymour:~$ sudo mount -t smbfs //10.10.10.20/homes
/mount/point -o username=sandra,dmask=777,\ fmask=777
NOTE
You can substitute the IP address for the hostname if your name service is
running or the host is in your /etc/hosts file.
The preceding command mounts sandra’s /home directory on your host
and gives all users full permissions to the mount. The permissions are equal to
the permissions on the chmod command.
The second method produces the same results using the smbmount
command, as follows:
Click here to view code image
matthew@seymour:~$ sudo smbmount //10.10.10.20/homes /mount/point -o
username=sandra,dmask-777,\ fmask=777
To unmount the share, use the following standard command: