| Print View | RSS |

Systems/SelfAdministered/BackupsSambaLinux

Computer Systems > Self Administered Systems > Mounting Samba Linux

Mounting Samba Shares on Linux

If you have installed a recent version of Linux, chances are that you have also installed the two utilities called smbclient and smbmount, which can be used to access samba shares. If they are not installed, a quick search on the web will tell you how to install them.

For what it is worth, we recommend using smbmount instead of smbclient. The reason is that smbmount can be used to actually mount your home so that it appears to be a locally mounted filesystem.

Smbmount

Create a new sub-directory in your Linux file-system.

(For the sake of these instructions I shall create: /mnt/cslabhome)

$ mkdir /mnt/cslabhome

Now use this new directory as a mount point for mounting your HOME directory.

(I shall use the CSLab username: jerry)

$ smbmount //smb.cs.toronto.edu/jerry /mnt/cslabhome -o username=jerry

You will be prompted for your CSLab password. Please only supply the first eight characters.

At this point your HOME directory is now mounted. You can check this by running these two commands:

$ cd /mnt/cslabhome
$ ls

To unmount your HOME directory, use the command:

$ smbumount /mnt/cslabhome

/!\ WARNING: It is necessary that you smbumount each time you logoff or else you will be left with stale shares. If you discover that you can not do a smbumount, since the shares have become stale, then you will need to reboot Linux.

Smbclient

Smbclient is rather less useful than smbmount but it does enable you to copy files between your Linux laptop and your HOME directory. It is somewhat similar to ftp in terms of functionality and ease of use.

Run the command:

$ smbclient //smb.cs.toronto.edu/username -U username

So, if the CSLab user called Jerry wants to access his HOME dir, he would type:

$ smbclient //smb.cs.toronto.edu/jerry -U jerry

Once authenticated, you will see the smbclient prompt:

smb:\>

A good starting point on learning how to use smbclient is the command "?":

smb:\> ?

Known Problems

If your login fails, here are some gotchas:

  1. If you receive an error message, the chances are that there is a problem with your password.
  2. If your password is longer than 8 characters, only supply the first 8 characters.
  3. If your password does contain an '[' or a ']', change it so that it does not. SAMBA can balk when offered such passwords.
  4. If this still does not work, you might have to resynch your password with our SAMBA password file. The easiest way to do this is to reset your password via passwd. Wait 30 minutes and try again.